db_0127: Limitation on MATLAB commands in Stateflow blocks
Since R2020a
Guideline Publication
Control Algorithm Modeling Guidelines - Using MATLAB®, Simulink®, and Stateflow®
Sub ID Recommendations
NA-MAAB — a, b
JMAAB — a, b
MATLAB Versions
All
Rule
Sub ID a
Built-in MATLAB functions shall not be used in Stateflow blocks.
Applicable for C charts
Not Applicable
MATLAB commands are not used in Stateflow blocks.
A MATLAB command is used in the Stateflow block.
Sub ID b
When a built-in MATLAB function is used in Stateflow blocks, it shall be accessed only by using MATLAB Function.
Applicable for C charts
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 a:
Not all built-in MATLAB functions are supported for code generation. As a result, code may not be generated for these unsupported MATLAB functions.
Sub ID b:
Not all built-in MATLAB functions are supported for code generation. As a result, code may not be generated for these unsupported MATLAB functions.
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
R2024b
See Also
Version History
Introduced in R2020a