na_0016: Source lines of MATLAB Functions

ID: Title

na_0016: Source lines of MATLAB® Functions

Priority

Mandatory

Scope

NA-MAAB

MATLAB Versions

See description

Prerequisites

None

Description

The length of MATLAB functions should be limited, with a recommended limit of 60 lines of code. This restriction applies to MATLAB Functions that reside in the Simulink® block diagram and external MATLAB files with a .m extension.

If sub-functions are used, they may use additional lines of code. Also limit the length of sub-functions to 60 lines of code.

Rationale

  • Readability

  • Verification and Validation

  • Workflow

  • Code Generation

See Also

  • IM_0008: Source lines of eML

Last Changed

V3.0

Model Advisor Check

By Task > Modeling Standards for MAAB > MATLAB Functions > Check MATLAB Function block metrics

Was this topic helpful?