Main Content

Check the length of data names in MATLAB Functions

Check ID: mathworks.jmaab_v6.jc_0906

Guideline: jc_0906: Length restriction for data names in MATLAB® function

Description

Checks if the lengths of data names in MATLAB functions adhere to the minimum and maximum length restrictions specified by the input parameters.

The default minimum length is 1. The default maximum length is 63.

This check applies to the following target components:

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

  • Local data names defined 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 does not include sub-checks because the JMAAB modeling guideline provides only one sub ID.

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

  • JMAAB — a

You can configure the following input parameters to customize the check action:

Input ParameterValueDefault Value
Minimum length of data name in MATLAB function.Minimum length for a data name in a MATLAB function.1
Maximum length of data name in MATLAB function.Maximum length for a data name in a MATLAB function.63

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

Results and Recommended Actions

ConditionRecommended Action
Data names in MATLAB functions do not adhere to the minimum length restriction. Modify data names in MATLAB functions so that their lengths are not less than the value specified by the Minimum length of data name in MATLAB Function input parameter.
Data names in MATLAB functions do not adhere to the maximum length restriction. Modify data names in MATLAB functions so that their lengths are not greater than the value specified by the Maximum length of data name in MATLAB Function input parameter.

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.