db_0127: Limitation on MATLAB commands in Stateflow blocks
Sub ID Recommendations
NA-MAAB — a1/a2
JMAAB — a1/a2
MATLAB Versions
All
Rule
Sub ID a1
MATLAB® commands shall not be used in Stateflow® blocks.
Not Applicable
MATLAB commands are not used in Stateflow blocks.
A MATLAB command is used in the Stateflow block.
Sub ID a2
When a MATLAB command is used in Stateflow blocks, it shall be accessed only by using MATLAB Function block.
Not Applicable
The MATLAB command is accessed by using the MATLAB Function block.
A MATLAB Function block is not used for a MATLAB command.
Rationale
Sub ID a1:
Not all MATLAB commands are supported for code generation. As a result, code may not be generated for these unsupported MATLAB commands.
Sub ID a2:
Not all MATLAB commands are supported for code generation. As a result, code may not be generated for these unsupported MATLAB commands.
Readability improves when C and MATLAB action languages are described separately.
Verification
Model Advisor check: Check for MATLAB expressions in Stateflow charts (Simulink Check)
Last Changed
R2020a
See Also
JMAAB guideline db_0127, which is available in Control Algorithm Modeling Guidelines Using MATLAB, Simulink, and Stateflow on the MathWorks® website.
Stateflow Programmatic Interface (Stateflow)
Differences Between MATLAB and C as Action Language Syntax (Stateflow)
Version History
Introduced in R2020a