I'm running Monte Carlo simulation in Matlab 2012a, the following code returns an error
if matlabpool('size') == 0
(Definitions of x ,y, z are simplified but the main idea remains) As I understand it is impossible to use indexing this way in a nested 'for' 'cos Matlab cannot check if array elements are independent. But in my situation it's clear that index i (different MC paths are independent) is remaining unchanged in for loop, only j (time steps) is being changed. Could you please give me a piece of advice with this issue?
Thanks in advance, Alex.
P.S. the error is obvious for such cases: The variable x in a parfor cannot be classified.