メインコンテンツ

Simulink Design Summary

R2026b
Since R2026b

Metric ID

modeldesign.SimulinkMaintainability[slcomp.DesignSummary]

Description

This metric returns a summary of maintainability measurements for the Simulink® design layers in each unit. The summary includes the total number of design layers, the total block count, signal line count, Goto count, and the accumulated Halstead difficulty and cyclomatic complexity across all Simulink design layers in the unit.

Supported Artifacts

This metric collects metric results for Units in the project. To control what the dashboard classifies as a unit, see Categorize Models in Hierarchy as Components or Units.

Collection

To collect data for this metric, execute the metric engine with the metric ID.

metric_engine = metric.Engine;
results = execute(metric_engine,"modeldesign.SimulinkMaintainability[slcomp.DesignSummary]")

View the metric result values for a specific unit.

results(1).Value
results(1).ScopeAlias

You can also collect all Simulink maintainability metrics at once by using the group ID.

results = execute(metric_engine,"modeldesign.SimulinkMaintainability[]")
Use the MetricID property of each result to identify which metric the result belongs to.

Results

The metric returns an array of metric.Result objects, one for each unit in the project. Use the Value property of the metric result object to view the metric result values. Use the ScopeId and ScopeAlias properties to identify which unit the result belongs to.

The ScopeAlias property returns the name of the unit.

The Value property returns a structure with these fields:

  • AccumulatedElements — Total number of Simulink design layers in the unit

  • Blocks — Total number of blocks across all Simulink design layers in the unit

  • Complexity — Accumulated cyclomatic complexity across all Simulink design layers in the unit

  • Gotos — Total number of Goto blocks across all Simulink design layers in the unit

  • HalsteadDifficulty — Accumulated Halstead difficulty across all Simulink design layers in the unit

  • SignalLines — Total number of signal lines across all Simulink design layers in the unit

See Also

Topics