Main Content

jc_0753: Condition actions and transition actions in Stateflow

Since R2020a

Guideline Publication

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

Sub ID Recommendations

  • NA-MAAB — a1/a2

  • JMAAB — a1/a2

MATLAB Versions

All

Rule

Sub ID a1

Transition actions shall not be used in a Stateflow Chart (Stateflow).

Custom Parameter

Not Applicable

Example — Correct

Only a condition action is used.

Example — Incorrect

A transition action is used.

Sub ID a2

Condition actions and transition actions shall not be combined in the same Stateflow Chart (Stateflow).

Custom Parameter

Not Applicable

Example — Correct

Either a condition action or a transition action can be used. (The following diagram illustrates a transition action.)

Example — Incorrect

Includes both a condition action and a transition action.

Rationale

Sub ID a1:

  • Prevents confusion with a condition action, thus improving readability.

Sub ID a2:

  • A condition action executes upon entering a transition. A transition action executes after determining whether it can transition to the next state. Adherence to the rule prevents confusion between a conditional action and a transition action.

Verification

Model Advisor check: Check condition actions and transition actions in Stateflow (Simulink Check)

Last Changed

R2020a

Version History

Introduced in R2020a