parfor
Parallel for-loop
Syntax
Description
parfor executes a series of MATLAB® statements for values of loopvar = initval:endval; statements;
endloopvar between
initval and endval, inclusive, which
specify a vector of increasing integer values. The loop runs in parallel when you
have Parallel Computing Toolbox™ or when you create a MEX function or standalone code with MATLAB
Coder™. Unlike a traditional for-loop, iterations are not
executed in a guaranteed order. You cannot call scripts directly in a
parfor-loop. However, you can call functions that call
scripts.
parfor ( executes statements in a loop using a maximum of loopvar = initval:endval, M); statements;
endM
workers or threads, where M is a nonnegative integer.
Examples
Tips
Extended Capabilities
Version History
Introduced in R2008a