counter =0;parfor i = 1:1000 max=999; if max < i max = i; disp(max); assignin('base','counter',max); end enddisp(counter);
For example, I want to keep max value but I got zero
Parallel Computing Toolboxparforparfor temporary variables
counter =0;parfor i = 1:1000 max=999; if max < i max = i; disp(max); assignin('base','counter',max); end enddisp(counter);
Best Answer