User`s guide
2 Parallel for-Loops (parfor)
2-14
B = @sin;
for ii = 1:100
A(ii) = B(ii);
end
A corresponding parfor-loop does not allow B to reference a function handle. So you can
work around the problem with feval:
B = @sin;
parfor ii = 1:100
A(ii) = feval(B,ii);
end
More About
• “parfor Limitations” on page 2-11
• “Sliced Variables” on page 2-27