Troubleshooting parfor-Loops

Global or Persistent Declarations in parfor-Loop

The body of a parfor-loop cannot contain a global or persistent variable declaration.

Compiler Does Not Support OpenMP

The MATLAB® Coder™ software uses the Open Multiprocessing (OpenMP) application interface to support shared-memory, multicore code generation. To generate a loop that runs in parallel on shared-memory, multicore platforms, use a compiler that supports OpenMP. OpenMP is enabled by default. If your compiler does not support OpenMP, MATLAB Coder generates a warning.

Install a compiler that supports OpenMP. See Supported Compilers.