Main Content

MATLAB Decision Distribution

Since R2022b

Metric ID

slcomp.MATLABDecisionsDistribution

Description

Use this metric to determine the distribution of the number of decisions in MATLAB® code.

This metric analyzes the MATLAB functions and methods in:

  • MATLAB files

  • MATLAB Function blocks

For information on how the number of MATLAB decisions is calculated, see MATLAB Decision Count.

Supported Artifacts

You can collect this metric for:

To control what the dashboard classifies as a unit or component, see Categorize Models in Hierarchy as Components or Units.

Collection

To collect data for this metric:

  • In the Model Maintainability Dashboard, in the Design Cyclomatic Complexity Breakdown section, click the Run metrics for widget icon. The distribution of decisions appears in the MATLAB row and Distribution column.

  • Use getMetrics with the metric identifier slcomp.MATLABDecisionsDistribution.

Results

For this metric, instances of metric.Result return Value as a distribution structure that contains these fields:

  • BinCounts — The number of artifacts in each bin, returned as a vector.

  • BinEdges — Bin edges for the number of MATLAB decisions, returned as a vector. BinEdges(1) is the left edge of the first bin and BinEdges(end) is the right edge of the last bin. The length of BinEdges is one more than the length of BinCounts.

The bins in this metric result correspond to the bins in the MATLAB row and Distribution column in the Design Cyclomatic Complexity Breakdown section.

See Also

Related Topics