The variable g in a parfor cannot be classified..
1 view (last 30 days)
Can anyone help me with this?
z1r=normrnd(Z1(1),Z1(2)); %Random sample from distribution of Z1
z2r=normrnd(Z2(1),Z2(2)); %Random sample from distribution of Z2
if g(i)>0 %safe
Edric Ellis on 23 Oct 2014
Edited: Edric Ellis on 23 Oct 2014
It looks like you could simply replace g(i) with g and then hoist the inner for-loop bounds calculation out of the PARFOR loop. (Inner FOR loops must have constant bounds to be able to run correctly).
tn = size(T, 2);
parfor j = 1:N
for i = 1:tn