Simulink Component Interface
R2026bMetric 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[]")MetricID property of each result to identify which metric the result
belongs to.Results
The metric returns an array of objects, one for each Simulink design layer in the project. Use the metric.ResultValue 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 layerOutports— Number of output ports on the design layerSimulinkElement— Structure identifying the design layer, with fields:Alias— Name of the Simulink design layerURI— Unique resource identifier for the design layer