Input and Output Component Interface Ports
R2026bMetric ID
slcomp.InterfacePorts
Description
Use this metric to count the number of input ports and output ports to the component interface.
This metric counts:
Simulink® Inport blocks
Simulink Outport blocks
Input ports for Stateflow® charts
Output ports for Stateflow charts
Inputs and outputs to MATLAB® code
Supported Artifacts
You can collect this metric for Units and Components. To control what the dashboard classifies as a unit or component, see Categorize Models in Hierarchy as Components or Units.
Computation Details
The metric returns the number of component interfaces.
Collection
To collect data for this metric, execute the metric engine with the metric ID.
metric_engine = metric.Engine;
results = execute(metric_engine,"slcomp.InterfacePorts")Results
For this metric, instances of metric.Result return the
Value as a vector that contains these elements:
Value(1)— The number of input component interface ports.Value(2)— The number of output component interface ports.
Suppose your component is a model that has eleven Inport blocks and
five Outport blocks, this metric returns a Result
array with a Value property of [11;5].