Main Content

selectComponents

Class: Advisor.Application
Namespace: Advisor

Select model components for Model Advisor analysis

Description

You can select model components for Model Advisor analysis. A model component is a model in the system hierarchy. Models that the root model references and that setAnalysisRoot specifies are model components. By default, all components are selected.

selectComponents(app) includes all components for Model Advisor analysis.

example

selectComponents(app,Name,Value) includes model components specified by Name,Value pair arguments for Model Advisor analysis.

example

Input Arguments

expand all

Model Advisor application object, specified as an Advisor.Application object. You can use an Advisor.Application object to run Model Advisor checks on a model reference hierarchy. Create an Advisor.Application object by using the method Advisor.Manager.createApplication.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Components to select for Model Advisor analysis, as specified by a cell array of IDs

Data Types: cell

Select components specified by IDs and component children from Model Advisor analysis.

Data Types: logical

Examples

expand all

This example shows how to set the root model, create an Advisor.Application object, set root analysis, and include model components in Model Advisor analysis.

% Open the model
openExample('sldemo_mdlref_basic');

% Set root model to  sldemo_mdlref_basic model
RootModel='sldemo_mdlref_basic';

% Create an Application object
app = Advisor.Manager.createApplication();

% Set the Application object root analysis
setAnalysisRoot(app,'Root',RootModel);

% Select all components
selectComponents(app);

This example shows how to set the root model, create an Advisor.Application object, set root analysis, and include model components using IDs.

% Open the model
openExample('sldemo_mdlref_basic'); 

% Set root model to  sldemo_mdlref_basic model
RootModel='sldemo_mdlref_basic';

% Create an Application object
app = Advisor.Manager.createApplication();

% Set the Application object root analysis
setAnalysisRoot(app,'Root',RootModel);

% Select component using IDs
selectComponents(app,'IDs',RootModel);

Version History

Introduced in R2015b