Main Content

getAvailableMetricIds

Return metric identifiers for available metrics

Since R2022a

Description

example

availableMetricIds = getAvailableMetricIds(metricEngine) returns the metric identifiers for the metrics available for the specified metricEngine object. By default, the list includes only the metrics available with the current installation.

example

availableMetricIds = getAvailableMetricIds(metricEngine,'App','DesignCostEstimation') returns the metric identifiers for design cost estimation metrics. For an additional syntax to display metric identifiers for requirements-based model metrics, see getAvailableMetricIds (Simulink Check).

example

availableMetricIds = getAvailableMetricIds(___,'Installed',installationStatus) returns the metric identifiers filtered by the installation status specified by installationStatus. For example, specifying installationStatus as false returns the metric identifier for each available metric, even if the associated MathWorks® products are not currently installed on your machine.

Examples

collapse all

Create a metric.Engine object and view all metrics available with the current installation.

metric_engine = metric.Engine();
ids = getAvailableMetricIds(metric_engine);

Create a metric.Engine object and view all design cost metrics available.

metric_engine = metric.Engine();
ids = getAvailableMetricIds(metric_engine,...
    'App','DesignCostEstimation',...
    'Installed',false)
ids = 

  1×2 string array

    "DataSegmentEstimate"    "OperatorCount"

Input Arguments

collapse all

Metric engine object for which to collect metric results, specified as a metric.Engine object.

Filter for metric installation status, specified as one of these values:

  • 1 (true) — Returns only metric identifiers associated with the MathWorks products currently installed on your machine.

  • 0 (false) — Returns metric identifiers for each available metric, even if the associated MathWorks products are not currently installed on your machine.

Example: false

Data Types: logical

Output Arguments

collapse all

Metric identifiers for available metrics, returned as a string or string array. For a list of design cost metrics and their identifiers, see Design Cost Model Metrics. For a list of requirements-based model testing metrics and their identifiers, see Model Testing Metrics (Simulink Check).

Example: "DataSegmentEstimate"

Example: ["DataSegmentEstimate","OperatorCount"]

Version History

Introduced in R2022a