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_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

  • NASA Orion style guideline IM_0008: Source lines of eML

Last Changed

V3.0

Model Advisor Check

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

For check details, see Check MATLAB Function metrics (Simulink Check).

Introduced in R2013a