Main Content

Check for MATLAB expressions in Stateflow charts

Check ID: mathworks.jmaab_v6.db_0127

Guideline: db_0127: Limitation on MATLAB® commands in Stateflow® blocks

Description

Identifies the Stateflow objects that use MATLAB expressions that are not suitable for code generation.

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 MAB guideline sub ID(s) that are recommended for use by the NA-MAAB and JMAAB modeling standards organizations are:

  • NA-MAAB — a, b

  • JMAAB — a, b

Note

Sub-checks db_0127_a and db_0127_b are selected by default.

Results and Recommended Actions

Guideline Sub IDConditionRecommended Action
db_0127_a: Check for MATLAB functions and scripts in Stateflow blocksOne or more Stateflow blocks in the model use MATLAB functions or scripts.Consider remodeling by replacing all MATLAB functions and scripts in Stateflow blocks.
db_0127_b: Check for MATLAB functions and scripts in Stateflow blocks not accessed through a MATLAB functionOne or more Stateflow blocks in the model use MATLAB functions or scripts that are not accessed through a MATLAB function.Consider remodeling so that MATLAB functions and scripts are accessed through MATLAB functions in Stateflow blocks.

Capabilities and Limitations

  • Applies only to Stateflow charts that use C as the action language.

  • Runs on library models.

  • Allows exclusions.

  • 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 graphical.

Edit-Time Checking

This check is supported by edit-time checking.