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>:[<a1>,<a2>,...,<an>] (Bundle of Compiler Settings).
Turn On All Optimizations
To turn on all optimizations, use
This bundle is stored in <matlab>/toolbox/compiler/bundles/opt_bundle_all
. By default, all optimizations, except speculate
, 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
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
where <optimization option>
is
array_indexing
fold_mxarrays
fold_non_scalar_mxarrays
fold_scalar_mxarrays
optimize_conditionals
optimize_integer_for_loops
percolate_simple_types
speculate
List All Optimizations
To list all available optimizations, use
![]() | Optimizing Performance | Optimizing Arrays | ![]() |