"parfor" is not allowed in the first bit of code because "parfor" is not able to deduce that there will never be two different n, n1 and n2, such that [a(n1),b(n1)] == [a(n2),b(n2)] . Because if there were such a pair then two different workers could end up trying to write to that location in q() at the same time.
"parfor" is allowed in the second bit of code because "parfor" is able to deduce that all destination locations q(n) are unique and so no two workers will conflict in writing to a single location.
Note: if you were to switch your find() to only emit a single index, say "c",
c = find(...);
for n = 1 : numel(c)
q(c(n)) = ...
end
then you would still have difficulties because again parfor would not be able to deduce that no two c(*) were the same.
Depending on the work involved in field_ea and whether it is vectorizable, you should consider the loopless
q = zeros(size(R));
idx = R > limit;
q(idx) = field_ea( R(idx) );