FUNCTION REFERENCE

parfor

Parallel for-loop; runs serially in MatRust.

Parallel for-loop; runs serially in MatRust.

Syntax

parfor k = start:stop, statements, end

Syntax

parfor (k = start:stop, M), statements, end

MatRust has one worker, the client, so parfor runs exactly like for, in loop order. M (the most workers to use) is evaluated and ignored. Results equal those of the same for loop.

Example

s = 0; parfor k = 1:4, s = s + k; end   % s = 10

Differences from MATLAB: Runs serially in MatRust. Iterations run in order and the classification of loop variables (sliced, reduction, broadcast) is not checked.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.