Main Content

jc_0711: Division 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

Variables, constants, or parameters in Stateflow Chart (Stateflow) shall not be used to perform division operations.

Custom Parameter

Not Applicable

Example — Correct

Division is performed outside of the Stateflow Chart.

Example — Incorrect

Division occurs within the Stateflow Chart.

Sub ID a2

When division occurs in a Stateflow Chart (Stateflow), the process shall prevent division by zero.

Custom Parameter

Not Applicable

Example — Correct

The process is defined to prevent division by zero.

Example — Incorrect

The process does not prevent division by zero.

Rationale

Sub ID a1, a2:

  • Deviation from the rule can cause unintended operation and code generation results.

Verification

Model Advisor check: Adherence to this modeling guideline cannot be verified by using a Model Advisor check.

Last Changed

R2020a

Version History

Introduced in R2020a