Parameter Metric
R2026bNote
The Metrics Dashboard app, model metrics, slmetric API, and corresponding customizations will be removed in a future release. For more information, see Migrating from Metrics Dashboard to Model Design Dashboards.
Metric ID
Metric ID:
mathworks.metrics.ParameterCount
Description
Metric Type: Size
Use this metric to calculate the number of instances of parameter data inside a Simulink® system.
A parameter is a variable used by a Simulink block or object of a basic type (which includes single,
double, uint8, uint16,
uint32, int8, int16,
int32, boolean, logical,
struct, char, cell),
Simulink.Parameter object,
Simulink.VariantExpression object, or enum
value. This metric returns every instance of a parameter in a model, which means that
the metric counts each instance of a parameter separately. The parameter data must be
located in the base workspace, the model workspace, or a data dictionary.
For example, if a model uses the parameter Kp in two different
Gain blocks, the metric counts both instances separately. The metric also counts
parameter instances in subsystems.
This metric is available with Simulink
Check™. To collect data for this metric, use getMetrics with the metric identifier,
mathworks.metrics.ParameterCount.
The slmetric.metric.AggregationMode property setting is
Sum.
Computation Details
This metric:
Filters results from the
Simulink.findVarsfunction and inherits the limitations of this function.Counts the parameter instances in a component rather than unique parameters.
Does not include parameters in masked workspaces.
Does not include data type and signal objects.
If specified, analyzes the content of library-linked blocks or referenced models.
Results
For this metric, instances of slmetric.metric.Result provide the
following results:
Value: Number of parameter instances used inside a component.AggregatedValue: Number of parameter instances for a component and its subcomponents.Measures: Not applicable.