NA-MAAB — a1/a2
JMAAB — a1/a2
All
When Stateflow®
Chart (Stateflow) property Action
Language (Stateflow) is set to C
, Stateflow data property First Index (Stateflow) shall be set to
0
.
Not Applicable
First Index is set to a combination of
0
, 1
, and 2
.
When Stateflow
Chart (Stateflow) property Action
Language (Stateflow) is set to C
, Stateflow data property First Index (Stateflow) shall be set to
1
.
Not Applicable
First Index is set to a combination of
0
, 1
, and 2
.
Sub ID a1:
Logic becomes easier to understand when First Index is uniform.
Sub ID a2:
Logic becomes easier to understand when First Index is uniform. However, C language is 0-based, which decreases the readability of the code as the index calculation process is 1-based. This is reflected in the generated code.
Model Advisor check: Check usable number for first index (Simulink Check)
R2020a
JMAAB guideline jc_0701, which is available in Control Algorithm Modeling Guidelines Using MATLAB, Simulink, and Stateflow on the MathWorks® website.
Differences Between MATLAB and C as Action Language Syntax (Stateflow)
Set Data Properties (Stateflow)