User`s guide

vi Contents
Reductions: Cumulative Values Updated by Each Iteration . 2-8
parfor Programming Considerations . . . . . . . . . . . . . . . . . . 2-10
MATLAB Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
parfor Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Inputs and Outputs in parfor-Loops . . . . . . . . . . . . . . . . . . . 2-12
Functions with Interactive Inputs . . . . . . . . . . . . . . . . . . . . 2-12
Displaying Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
Objects and Handles in parfor-Loops . . . . . . . . . . . . . . . . . . 2-13
Using Objects in parfor-Loops . . . . . . . . . . . . . . . . . . . . . . . 2-13
Handle Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
Sliced Variables Referencing Function Handles . . . . . . . . . . 2-13
Nesting and Flow in parfor-Loops . . . . . . . . . . . . . . . . . . . . . 2-15
Nested Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
Nested Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
Nested spmd Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
Break and Return Statements . . . . . . . . . . . . . . . . . . . . . . . 2-17
P-Code Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
Variables and Transparency in parfor-Loops . . . . . . . . . . . 2-19
Unambiguous Variable Names . . . . . . . . . . . . . . . . . . . . . . 2-19
Transparency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19
Structure Arrays in parfor-Loops . . . . . . . . . . . . . . . . . . . . 2-20
Scalar Expansion with Sliced Outputs . . . . . . . . . . . . . . . . 2-21
Global and Persistent Variables . . . . . . . . . . . . . . . . . . . . . 2-22
Classification of Variables in parfor-Loops . . . . . . . . . . . . . 2-23
Notes about Required and Recommended Guidelines . . . . . . 2-24
Loop Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25
Sliced Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
Characteristics of a Sliced Variable . . . . . . . . . . . . . . . . . . . 2-27
Sliced Input and Output Variables . . . . . . . . . . . . . . . . . . . 2-29
Broadcast Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-31