This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

na_0017: Number of called function levels

ID: Title

na_0017: Number of called function levels





MATLAB Versions





The number of levels of sub-functions should be limited, typically to 3 levels. MATLAB® Function blocks that reside at the Simulink® block diagram level count as the first level, unless it is simply a wrapper for an external MATLAB file with a .m extension.

This includes functions that are defined within the MATLAB block and those in the separate .m files.


Standard utility functions, such as built-in functions like sqrt or log, are not include in the number of levels. Likewise, commonly used custom utility functions can be excluded from the number of levels.


  • Readability

  • Verification and Validation

Last Changed


Model Advisor Check

By Task > Modeling Standards for MAAB > MATLAB Functions > Check the number of function calls in MATLAB Function blocks

For check details, see Check the number of function calls in MATLAB Function blocks.

Introduced in R2013a