na_0037: Use of single variable for variant condition
Control Algorithm Modeling Guidelines - Using MATLAB®, Simulink®, and Stateflow®
Sub ID Recommendations
NA-MAAB — a
JMAAB — a
Sub ID a
Variant conditions shall be used to prohibit compound conditions that are formed from multiple variables.
Conditional expressions that are formed from multiple variables can be used when using default variants.
The variant condition is set by a single condition that is formed from multiple variables.
The usage of enumerated type variables is recommended in a condition equation. This example uses numerical values to improve readability.
The variant condition is set by a compound condition that is formed from multiple variables.
Sub ID a:
Complicates the conditions, which makes it difficult to determine which subsystem will become active. This can result in conditions being omitted.
When conditions are omitted, there is a risk that there may not be an active subsystem.
Model Advisor check: Check use of single variable variant conditionals (Simulink Check)
Introduced in R2020a