User`s guide

Classification of Variables in parfor-Loops
2-23
Classification of Variables in parfor-Loops
When a name in a parfor-loop is recognized as referring to a variable, the variable is
classified into one of several categories. A parfor-loop generates an error if it contains
any variables that cannot be uniquely categorized or if any variables violate their
category restrictions.
Classification Description
“Loop Variable”
on page 2-25
Loop index
“Sliced
Variables” on
page 2-27
Arrays whose segments are operated on by different iterations of the
loop
“Broadcast
Variables” on
page 2-31
Variables defined before the loop whose value is required inside the
loop, but never assigned inside the loop
“Reduction
Variables” on
page 2-32
Variables that accumulate a value across iterations of the loop,
regardless of iteration order
“Temporary
Variables” on
page 2-39
Variables created inside the loop, and not accessed outside the loop
Each of these variable classifications appears in this code fragment: