User`s guide
2 Parallel for-Loops (parfor)
2-22
x = zeros(10,12);
parfor idx = 1:12
x(:,idx) = idx;
end
The following code offers a suggested workaround for this limitation.
x = zeros(10,12);
parfor idx = 1:12
x(:,idx) = repmat(idx,10,1);
end
Global and Persistent Variables
The body of a parfor-loop cannot contain global or persistent variable declarations.
More About
• “parfor Limitations” on page 2-11
• “Classification of Variables in parfor-Loops” on page 2-23