주요 콘텐츠

Simulink Component Interface

R2026b
Since R2026b

Metric ID

modeldesign.SimulinkMaintainability[slcomp.ComponentInterface]

Description

This metric returns the number of inports and outports for each Simulink® design layer in a unit. Use this metric to identify design layers with complex interfaces that may be difficult to integrate and maintain.

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.ComponentInterface]")

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 Simulink design layer 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 Value property returns missing when the design layer does not have a Simulink component interface. When a component interface exists, the Value property returns a structure with these fields:

  • Inports — Number of input ports on the design layer

  • Outports — Number of output ports on the design layer

  • SimulinkElement — Structure identifying the design layer, with fields:

    • Alias — Name of the Simulink design layer

    • URI — Unique resource identifier for the design layer

See Also

Topics