Main Content

Check Indexing Mode

Check ID: mathworks.jmaab.db_0112

Guideline: db_0112: Usage of index

Description

Identifies blocks and charts with inconsistent Indexing mode.

Blocks with either 0 or 1 based indexing:

  • Assignment

  • For Iterator Subsystem

  • Find

  • Multiport Switch

  • Selector

Blocks with default 1 based indexing:

  • MATLAB® Function

  • Fcn

  • MATLAB System

  • Truth Table

  • State Transition Table

  • Test Sequence

Note

  • For Simulink, there are no blocks with default zero-based indexing.

  • For Stateflow, if action language for a chart is set to MATLAB, it is 1 based indexing, if the action language is set to C it is 0 based indexing.

This check requires Simulink® Check™ and Stateflow® licenses.

Check Parameterization

This check contains sub-checks that correspond to sub IDs specified in the MAB and JMAAB modeling guidelines. You can use the Model Advisor Configuration Editor to specify which sub IDs (one or multiple) to execute.

For reference, the MAB guideline sub ID(s) that are recommended for use by the NA-MAAB and JMAAB modeling standards organizations are:

  • NA-MAAB — a1/a2

  • JMAAB — a1/a2

Note

Sub-check db_0112_a1 is selected as the default

Results and Recommended Actions

Guideline Sub IDConditionRecommended Action
db_0112_a1: Check for Zero-Based Indexing ModeOne or more blocks or charts in the model have One-Based Indexing mode or Specify indices mode.Consider remodeling by using Zero-Based Indexing.
db_0112_a2: Check for One-Based Indexing ModeOne or more blocks or charts in the model have Zero-Based Indexing mode or Specify indices mode.Consider remodeling by using One-Based Indexing.

Capabilities and Limitations

  • Runs on library models.

  • Allows exclusions.

  • Analyzes content of library-linked blocks. By default, the input parameter Follow links is set to on.

  • Analyzes content in masked subsystems. By default, the input parameter Look under masks is set to graphical.