Main Content


Guidelines for improving generated code performance

When designing MATLAB® algorithms intended for code generation, observe the following guidelines to improve the performance of generated code.


MATLAB FunctionInclude MATLAB code in Simulink models


coder.areUnboundedVariableSizedArraysSupportedCheck if current configuration settings allow unbounded variable-size arrays (Since R2024a)
coder.inlineControl inlining of current function in generated code
coder.inlineCallInline called function in generated code (Since R2024a)
coder.nonInlineCallPrevent inlining of called function in generated code (Since R2024a)
coder.unrollUnroll for-loop by making a copy of the loop body for each loop iteration
coder.constFold expressions into constants in generated code