Main Content

jc_0738: Usage of Stateflow comments

Sub ID Recommendations

  • NA-MAAB — a

  • JMAAB — a, b

MATLAB Versions

All

Rule

Sub ID a

When Chart (Stateflow) parameter Action Language is set to C, /*...*/ comment nesting shall not be used.

Custom Parameter

Not Applicable

Example — Correct

Example — Incorrect

Sub ID b

When Chart (Stateflow) parameter Action Language is set to C, new line characters for comments /* */ shall not be used in the middle of a single comment.

Custom Parameter

Not Applicable

Example — Correct

Example — Incorrect

Rationale

Sub ID a:

  • The compiler can misinterpret the comments as a program.

Sub ID b:

  • A line break in the middle of a comment makes it difficult to determine whether the part being edited is in the comment. There is also a possibility that the comment is nested.

  • When Chart (Stateflow) parameter Action Language is set to MATLAB, comments must use %.

Verification

Model Advisor check: Check usage of Stateflow comments (Simulink Check)

Last Changed

R2020a

Introduced in R2020a