Main Content

jc_0900: Usable characters for data type definition

Since R2024b

Guideline Publication

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

Sub ID Recommendations

  • NA-MAAB — a, b, c

  • JMAAB — a, b, c

MATLAB Versions

All

Rule

Sub ID a

Underscores shall not be used at the end of bus object names, enumeration class names, or enumeration member names.

Custom Parameter

Not Applicable

Example — Incorrect

An underscore is used at the end of the bus object name.

An underscore is used at the end of the enumeration member name.

Sub ID b

Consecutive underscores shall not be used in bus object names, enumeration class names, or enumeration member names.

Custom Parameter

Not Applicable

Example — Incorrect

Consecutive underscores are used in the bus object name.

Consecutive underscores are used in the enumeration class name.

Consecutive underscores are used in the enumeration member name.

Sub ID c

Bus object names, enumeration class names and enumeration member names shall not be the same as reserved MATLAB words.

Custom Parameter

Not Applicable

Example — Incorrect

A bus object has the same name as a reserved MATLAB word.

A reserved MATLAB word that exactly matches the enumeration class name is used.

A reserved MATLAB word that exactly matches the enumeration member name is used.

Rationale

Sub ID a:

  • Deviation reduces readability. Since underscores are commonly used as word separators, it may look like a typographical error.

Sub ID b:

  • Deviation reduces readability.

Sub ID c:

  • Deviation reduces readability. Deviating from common practices may lead to unexpected problems.

    Note

    The MATLAB limit for the number of characters you can use bus object names, enumeration class names, or enumeration member names is 2048.

Verification

Model Advisor check: Check bus and enumeration data type names (Simulink Check)

Last Changed

R2024b

Version History

Introduced in R2024b