MATLAB Compiler | ![]() ![]() |
Optimization Bundles
All optimizations are controlled separately, and you can enable or disable any of the optimizations. To simplify the process, you can use the provided bundles of Compiler settings that allow you to select the most common optimization options. For more information on bundles, see -B <filename> (Bundle of Compiler Settings).
Turn On All Optimizations
To turn on all optimizations, use
-O all
This bundle is stored in <matlab>/toolbox/compiler/bundles/opt_bundle_all
. By default, all optimizations are on unless you specifically disable them or use the -g
option for debugging. The -g
option disables all optimizations.
Turn Off All Optimizations
To turn off all optimizations, use
-O none
This bundle is stored in <matlab>/toolbox/compiler/bundles/opt_bundle_none
. This optimization setting is used whenever you use -g
for debugging.
Turn On Individual Optimizations
You can enable or disable each individual optimization. To enable/disable an optimization, use
-O <optimization option>:[on|off]
where <optimization option>
is:
fold_scalar_mxarrays
fold_non_scalar_mxarrays
array_indexing
optimize_integer_for_loops
optimize_conditionals
List All Optimizations
To list all available optimizations, use
-O list
![]() | Optimizing Performance | Optimizing Arrays | ![]() |