This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Class: slmetric.Engine
Package: slmetric

Get metric data for one metric for analysis root only


metricResult = getAnalysisRootMetric(metric_engine,MetricID)


Get metric data from the metric engine where the root of analysis was set using setAnalysisRoot.


metricResult = getAnalysisRootMetric(metric_engine,MetricID) get the metric data from metric_engine, for a specified metric identifier, MetricID, only for the analysis root.

Input Arguments

expand all

When you call execute, metric_engine collects metric data for all available metrics or for the specified MetricID. Calling getMetrics accesses the collected metric data in metric_engine.

Metric identifier for Model Metrics or custom model metrics, that you create. You can get metric identifiers by calling slmetric.metric.getAvailableMetrics.

Example: 'mathworks.metrics.DescriptiveBlockNames'

Output Arguments

expand all

Outputs the object of the slmetric.metric.Result object containing the result data for the requested analysis root and metric.


expand all

This example shows how to set the analysis root, collect, and access the metric data for a metric.

% Create an slmetric.Engine object
metric_engine = slmetric.Engine();

% Specify the model for metric analysis
setAnalysisRoot(metric_engine, 'Root', 'sldemo_fuelsys');

% Collect model metrics for only the analysis root
metricID = 'mathworks.metrics.SimulinkBlockCount';
execute(metric_engine, metricID);

metricResult = getAnalysisRootMetric(metric_engine, metricID);

Introduced in R2017a