na_0017: Number of called function levels

ID: Title

na_0017: Number of called function levels

Priority

Mandatory

Scope

NA-MAAB

MATLAB Versions

All

Prerequisites

None

Description

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.

Note

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.

Rationale

  • Readability

  • Verification and Validation

Last Changed

V3.0

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 (Simulink Check).

Introduced in R2013a