In analyzing a parfor
loop, Code Analyzer has found a
reduction variable that appears to be using a nonbroadcast variable reference as
the reduction function. A reduction function must be either a function name or a
broadcast variable. This message typically appears because there is an
assignment to the named reduction function within the
parfor
loop.
For more information, see the topics on broadcast variables and reduction assignments under Classification of Variables in parfor-Loops.
Ensure that you intend for the reduction to be within the loop, and that you define the variable used for the reduction function before the loop.