I am receiving the following error in using parfor. Is there any way to use Parfor for here?
The parfor loop cannot be run due to the way variable 'J' is used
parfor xpop = 1:XpopGxm = (X(xpop,M:Nvar)-0.5*ones(1,K)) * (X(xpop,M:Nvar)-0.5*ones(1,K))';Cos = cos(X(xpop,1:M-1)*pi/2);J(xpop,1) = prod(Cos)*(1+Gxm);for nobj = 1:M-1 J(xpop,nobj+1) = (J(xpop,1)/prod(Cos(1,M-nobj:M-1)))... * sin(X(xpop,M-nobj)*pi/2);end end*
Best Answer