Main Content

jc_0702: Use of named Stateflow parameters and constants

Since R2020a

Guideline Publication

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

Sub ID Recommendations

  • NA-MAAB — a

  • JMAAB — a

MATLAB Versions



Sub ID a

Stateflow block shall not use numeric literal.


  • Initial value is 0

  • Increment, decrement 1

Custom Parameter

Not Applicable

Example — Correct

Numeric literals are not used.

Example — Incorrect

Numeric literals are used.


Sub ID a:

  • Only the modeler will understand the purpose of the value when numeric literals are used to write constants, which decreases readability.

  • Constants that are intended for calibration are generated in the code using numeric literals.


Model Advisor check: Check usage of numeric literals in Stateflow (Simulink Check)

Last Changed


Version History

Introduced in R2020a