How to nest multiple parfor loops
MrAzzman already pointed out how to linearise nested loops. Here is a general solution to linearise n nested loops. 1) Assuming you have a simple nested loop structure like this: %dummy function for demonstration purposes f=@(a,b,c)([a,b,c]); %three loops X=cell(4,5,6); for a=1:size(X,1); for b=1:size(X,2); for c=1:size(X,3); X{a,b,c}=f(a,b,c); end end end 2) Basic linearisation using a for … Read more