Main Content
db_0112: Usage of index
Since R2020a
Guideline Publication
Control Algorithm Modeling Guidelines - Using MATLAB®, Simulink®, and Stateflow®
Sub ID Recommendations
NA-MAAB — a
JMAAB — a
Sub ID Recommendations
NA-MAAB — a1/a2
JMAAB — a1/a2
MATLAB Versions
All
Rule
Sub ID a1
A vector signal shall use a zero-based index mode.
Custom Parameter
Not Applicable
Example — Correct
A uniform zero-based index mode is used.
Example — Incorrect
A uniform index mode is not used.
Sub ID a2
A vector signal shall use a one-based index mode.
Custom Parameter
Not Applicable
Example — Correct
A uniform one-based index mode is used.
Example — Incorrect
A uniform index mode is not used (same as the incorrect example for sub ID a1).
Rationale
Sub IDs a1, a2
Logic is easier to understand when using a uniform index mode.
Verification
Model Advisor check: Check Indexing Mode (Simulink Check)
Last Changed
R2020a
See Also
Version History
Introduced in R2020a