Main Content

setAnalysisRoot

Class: slmetric.Engine
Package: slmetric

Specify model or subsystem for metric analysis

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 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(); 
setAnalysisRoot(metric_engine,'Root','vdp');
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(); 
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 specify a model for metric analysis.

Create an slmetric.Engine object.

metric_engine = slmetric.Engine();

Specify the model vdp as the root model for metric analysis.

setAnalysisRoot(metric_engine,'Root','vdp');

This example shows how specify a subsystem for metric analysis.

Create an slmetric.Engine object.

metric_engine = slmetric.Engine();

Set the subsystem enab1 as the root for metric analysis.

Subsys = 'sl_subsys_enab1/enab1';
setAnalysisRoot(metric_engine,'Root',Subsys,'RootType','Subsystem');
Introduced in R2016a