Suppose I have the following codep = cell(1,3);w = zeros(5,3);p{1} = X; 2 by 2 matrixp{2} = Y; 2 by 2 matrixp{3} = Z; 2 by 2 matrix parfor k=1:3 for i=1:5 w(i,k) = somefunction(variable1, variable2,p{k}) end end
If I remove the parfor, the code runs fine, but if I use the parfor I get the error: Output argument "XXXX" from some other function that is used in "somefunction" was not assigned during call.
Sorry for being very schematic but the actual code is very long has and uses numerous functions.
Best Answer