Main Content

jc_0656: Usage of Conditional Control blocks

Since R2020a

Guideline Publication

Control Algorithm Modeling Guidelines - Using MATLAB®, Simulink®, and Stateflow®

Sub ID Recommendations

  • NA-MAAB — No recommendations

  • JMAAB — a

MATLAB Versions

All

Rule

Sub ID a

To make all actions in the conditions explicit, these block parameters shall be set as follows :

  • For If blocks, select Show else condition

  • For Switch Case blocks, select Show default case

Custom Parameter

Not Applicable

Example — Correct

Using default behavior in the Switch Case block.

Example — Incorrect

Not using default behavior in the Switch Case block.

Rationale

Sub ID a:

  • Determining whether there is pointless processing or if something is missing from the design (such as a missing description) is easier when the processing of exceptions (else, default) is explicitly set in the model.

Verification

Model Advisor check: Check default/else case in Switch Case blocks and If blocks (Simulink Check)

Last Changed

R2020a

Version History

Introduced in R2020a