Main Content


Class: slmetric.Engine
Package: slmetric

Specify model or subsystem for metric analysis


Specify the model or subsystem for slmetric.Engine metric object analysis.


setAnalysisRoot(metric_engine,'Root',root) specifies the metric analysis root.

For an slmetric.Engine object, before you set the ModelReferencesSimulationMode and AnalyzeLibraries properties, specify the setAnalysisRoot method. The setAnalysisRoot method persists between model runs. If you change these property values and then apply the setAnalysisRoot method, the original values override the new values. For example, for one run, suppose you set these values:

metric_engine = slmetric.Engine(); 
metric_engine.ModelReferencesSimulationMode = 'AllModes'; 
metric_engine.AnalyzeLibraries = true;
For the next run, if you want to change the ModelReferencesSimulationMode or the AnalyzeLibraries properties, be sure to first specify the setAnalysisroot method:
metric_engine = slmetric.Engine(); 
metric_engine.AnalyzeModelReferences = false; 
metric_engine.AnalyzeLibraries = false;  


setAnalysisRoot(metric_engine,'Root',root,Name,Value) specifies the metric analysis root by using Name,Value pairs.

Input Arguments

expand all

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

Comma-separated Name,Value argument specifying model or subsystem path. Name is the argument name and Value is the corresponding value. Name must appear inside quotes.

Comma-separated Name,Value argument specifying the RootType


expand all

This example shows how to set the root model, create an slmetric.Engine object, and specify the model for metric analysis.

% Set root model to vdp model

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

% Specify model for metric analysis

This example shows how to set the root model, create an slmetric.Engine object, and specify a subsystem for metric analysis.

% Set subsystem to CounterA
Subsys ='sf_car/Engine';

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

% Set a subsystem for metric analysis
Introduced in R2016a