Hello. I'm working with a very long for-cycle (50x200x200 matrix) and I'd like to use parfor to reduce calculating time. I'm working on a 8 cores pc. Since what I know, the parfor works only if the statements does not depend ones by each other. This is an example of my problem:
a = zeros(3,3);w = magic(3);% This works!
parfor i = 1:3 a(1, i) = w(i, i);end% Won't work!
parfor i = 1:3 a(i, i) = w(i, i);end
Why the second one does not work?
Best Answer