Main Content

na_0019: Restricted variable names

Since R2020a

Guideline Publication

Control Algorithm Modeling Guidelines - Using MATLAB®, Simulink®, and Stateflow®

Sub ID Recommendations

  • NA-MAAB — a, b

  • JMAAB — Not supported

MATLAB Versions

All

Rule

Sub ID a

Reserved C variable names shall not be used as variable names in MATLAB code. For example, avoid using const, TRUE, FALSE, infinity, nil, double, single, or enum in MATLAB code.

Custom Parameter

Not Applicable

Sub ID b

Variable names that conflict with MATLAB functions, such as conv, shall not be used.

Custom Parameter

Not Applicable

Rationale

Sub IDs a, b:

  • Improves readability of the code

  • Code generation may not be possible.

Verification

Model Advisor check: Check usage of restricted variable names (Simulink Check)

Last Changed

R2020a

Version History

Introduced in R2020a