This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Guidelines for improving generated code performance


MATLAB Function Include MATLAB code in models that generate embeddable C code


coder.inline Control inlining in generated code
coder.unroll Unroll for-loop by making a copy of the loop body for each loop iteration
coder.const Fold expressions into constants in generated code

Examples and How To

Unroll for-Loops

Control loop unrolling.

Inline Code

Inlining eliminates the overhead of a function call by replacing the function call with the body of the function.

Eliminate Redundant Copies of Function Inputs

Use the same variable as a function input and output.

Generate Reusable Code

To reuse functions, save them in files or integrate external functions into generated code.

Control Run-Time Checks

Improve performance by disabling run-time checks.


LAPACK Calls for Linear Algebra in a MATLAB Function Block

LAPACK function calls improve the simulation speed of MATLAB Function block algorithms that call certain linear algebra functions.

Was this topic helpful?