| Contents | Index |
parfor loopvar = initval:endval; statements;
end
parfor (loopvar = initval:endval, M); statements;
end
parfor loopvar = initval:endval; statements; end executes a series of MATLAB statements for values of loopvar between initval and endval, inclusive, which specify a vector of increasing integer values. The loop occurs in parallel when you open a pool of workers with Parallel Computing Toolbox™. Unlike a traditional for-loop, iterations are not executed in a guaranteed order.
parfor (loopvar = initval:endval, M); statements; end executes statements in a loop using a maximum of M workers, where M is a nonnegative integer.
If you have Parallel Computing Toolbox software, see the function reference pages for parfor and matlabpool for additional information.
Perform three large eigenvalue computations using three workers or cores with Parallel Computing Toolbox software:
matlabpool(3) parfor i=1:3, c(:,i) = eig(rand(1000)); end

Explore how to use MATLAB to make advancements in engineering and science.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |