Your nested loops as they are do not exhibit any dependence on the loop parameters so you might want to reformat your code above. But in general, so long as your iterations are not dependent on each other and the number of iterations is large enough to support the delay in initializing the parallel processing, the parfor loop is allowed and it performs better (respectively). If your are working with a cell or matrix of some kind and your nested loops cover a connected portion of it, you can always use the linear index approach. For example
n=100;
s=0;
a=randi([1 n],n);
for i=1:n
for j=1:n
s=s+a(i,j);
end
end
can be rewritten as
n=100;
s=0;
a=randi([1 n],n);
for i=1:n^2
s=s+a(i);
end
But again if your array is large and your iterations do not depend on each other, it's usually better to take advantage of the 'parfor' construct.