Compiler optimization level


Sets the degree of optimization used by the compiler when generating code for acceleration, Stateflow® charts, MATLAB Function block, and MATLAB System block.

Category: Simulation Target


Default: Optimizations off (faster builds)

Optimizations off (faster builds)

Specifies the compiler not to optimize code. This results in faster build times.

Optimizations on (faster runs)

Specifies the compiler to generate optimized code. The generated code will run faster, but the model build will take longer than if optimizations are off.


  • The default Optimizations off is a good choice for most models. This quickly produces code that can be used with acceleration.

  • Set Optimizations on to optimize your code. The fast running code produced by optimization can be advantageous if you will repeatedly run your model with the accelerator.

Command-Line Information

Parameter: SimCompilerOptimization
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Related Topics