jc_0722: Local data definition in parallel states
Guideline Publication
Control Algorithm Modeling Guidelines - Using MATLAB®, Simulink®, and Stateflow®
Sub ID Recommendations
NA-MAAB — a
JMAAB — a
MATLAB Versions
All
Rule
Sub ID a
Local variables that are completely in one parallel state shall be defined in that state.
Not Applicable
Local variables are defined in the parallel state being used in that state.
Local variables are not defined in the parallel state being used in that state.
Rationale
Sub ID a:
Readability and maintainability can be improved by explicitly limiting the valid range of the variables, thereby avoiding unintended references and changes.
Verification
Model Advisor check: Check scope of data in parallel states (Simulink Check)
Last Changed
R2020a
See Also
Represent Operating Modes by Using States (Stateflow)
Parallel and Exclusive States (Stateflow)
Version History
Introduced in R2020a