Main Content

Check data names in MATLAB Functions

Check ID: mathworks.jmaab_v6.jc_0905

Guideline: jc_0905: Usable characters for data names in MATLAB® function

Description

Checks if data names in MATLAB functions adhere to the following guidelines standards.

  • Do not end with an underscore.

  • Do not have consecutive underscores.

  • Do not coincide with reserved MATLAB words.

Note

Reserved MATLAB words include the following:

This check applies to the following target components:

  • Local data names in a MATLAB Function block of a Simulink® model.

  • Local data names in a MATLAB function within a Stateflow® chart.

  • Local data names in an external MATLAB file that is referenced by a MATLAB Function block in a Simulink model or a MATLAB function within a Stateflow chart.

This check requires a Simulink Check™ license.

Check Parameterization

This check contains sub-checks that correspond to sub IDs specified in the JMAAB modeling guidelines. You can use the Model Advisor Configuration Editor to specify which sub IDs (one or multiple) to execute.

For reference, the guideline sub ID(s) that are recommended for use by the JMAAB modeling standards organizations are:

  • JMAAB — a, b, c

To include files with a .m extension in the analysis, select Check external .m files referenced in the model. The check box is selected by default.

Results and Recommended Actions

Guideline Sub IDConditionRecommended Action
jc_0905_a: Underscore at the end.One or more data names in a MATLAB function end with an underscore. Do not end data names in MATLAB functions with underscores.
jc_0905_b: Consecutive underscores.One or more data names in a MATLAB function have consecutive underscores.Do not use consecutive underscores in data names in MATLAB functions.
jc_0905_c: Single reserved MATLAB word.The data name in a MATLAB function is a reserved MATLAB word.Do not use reserved MATLAB words as data names in MATLAB functions.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library-linked blocks. By default, the input parameter Follow links is set to on.

  • Analyzes content in masked subsystems. By default, the input parameter Look under masks is set to all.

  • Allows exclusion of blocks and charts.