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.

setAnalysisRoot

Class: slmetric.Engine
Package: slmetric

Specify model or subsystem for metric analysis

Syntax

setAnalysisRoot(metric_engine,'Root',root)
setAnalysisRoot(metric_engine,'Root',root,Name,Value)

Description

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

example

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

For an slmetric.Engine object, before you set the AnalyzeModelReferences 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(); 
setAnalysisRoot(metric_engine,'Root','vdp');
metric_engine.AnalyzeModelReferences = true; 
metric_engine.AnalyzeLibraries = true;
For the next run, if you want to change the AnalyzeModelReferences or the AnalyzeLibraries properties, be sure to first specify the setAnalysisroot method:
metric_engine = slmetric.Engine(); 
setAnalysisRoot(metric_engine,'Root','vdp');
metric_engine.AnalyzeModelReferences = false; 
metric_engine.AnalyzeLibraries = false;  

example

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

Examples

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
RootModel='vdp';

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

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

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
setAnalysisRoot(metric_engine,'Root',Subsys,'RootType','Subsystem');

Introduced in R2016a