Main Content

Inline strategy for calls between MathWorks® functions and user functions

Control inlining between user-written functions and MathWorks functions

Since R2020b

Description

App Configuration Pane: Speed

Configuration Objects: coder.MexCodeConfig | coder.CodeConfig | coder.EmbeddedCodeConfig

Inlining behavior at all call sites where a function that you wrote calls a MathWorks function, or a MathWorks function calls a function that you wrote.

Even if you select the 'Always' or the 'Never' option for a setting, in certain cases, the code generator might not strictly follow that instruction. For example, if there is a conflict, the coder.inline('always') or coder.inline('never') directive placed inside a function body overrides this option. For more information, see Control Inlining to Fine-Tune Performance and Readability of Generated Code.

Settings

Readability

This value is the default value.

Almost never inlines function calls, except for calls to very small functions. Preserves modularity of code without sacrificing too much speed, whenever possible. Results in highly readable code.

Always

Always performs inlining at a call site.

Never

Never inlines function calls. Results in maximum readability. This setting might significantly reduce the performance of the generated code.

Speed

Uses internal heuristics to determine whether to perform inlining at a call site. This setting usually leads to highly optimized code.

Programmatic Use

Property: InlineBetweenUserAndMathWorksFunctions
Values: 'Readability' | 'Always' | 'Speed' | 'Never'
Default: 'Readability'

Version History

Introduced in R2020b