Main Content

Stateflow Decision Count

Metric ID

slcomp.StateflowDecisions

Description

For a given unit or component, this metric determines the number of Stateflow® decisions in each Stateflow:

  • Chart

  • Atomic subchart

  • Atomic box in a subchart

  • Linked atomic subchart

  • State Transition Table

  • Truth Table

Decision Counts for Common Stateflow Components

The metric returns both graphical decisions and MATLAB® code decisions. Graphical decisions are decisions based on the connections drawn graphically in a Stateflow chart. MATLAB code decisions are decisions based on code written in the MATLAB action language used in a Stateflow chart.

The following table shows how the metric calculates the decision count for common Stateflow components.

 Decision Counts Table

Computation Details

The metric is a heuristic that estimates the number of Stateflow decisions. The calculated decision count is not exact.

The metric:

  • Does not compile the model. The metric only considers static information.

  • Ignores Stateflow states and transitions that have syntax errors.

The metric aligns with the decision coverage returned by Simulink® Coverage™. For information, see Model Coverage for Stateflow Charts (Simulink Coverage).

Collection

To collect data for this metric, use getMetrics with the metric identifier slcomp.StateflowDecisions.

Results

This metric returns metric results for each unit and component in the project.

For each unit and component, the metric returns a metric.Result object with properties including:

  • Value — Structure with fields for:

    • GraphicalDecisions — Number of graphical decisions.

    • MATLABCodeDecisions — Number of MATLAB code decisions.

    • TotalDecisions — Total number of Stateflow decisions.

  • Scope — Structure with information about the unit or component.

Examples

To see the number of Stateflow decisions associated with different Stateflow components, see Decision Counts for Common Stateflow Components.

See Also

| | |

Related Topics