This is the original for loop before using parfor
, where I have a variable count
that keeps track of my progress.
for i = 1:um_Elements
for j = 1:Temp_Elements
% statements
% statements
% statements
if mod(count,10) == 0
fprintf('%d/%d completed\n',count,total);
end
count = count + 1;
end
end
However, if I use multi-core to do the for loop, I can't have the count
variable any more, since it updates itself outside the inner loop.
parfor i = 1:um_Elements
for j = 1:Temp_Elements
% statement
% statement
% statement
end
end
How can I use parallel and keep track of the overall progress at the same time? Thanks for any help.