Main Content

deselectComponents

Class: Advisor.Application
Package: Advisor

Clear model components from Model Advisor analysis

Description

You can clear model components from Model Advisor analysis. A model component is a model in the system hierarchy. Models that the root model references and that Advisor.Application.setAnalysisRoot specifies are model components.

example

deselectComponents(app) clears all components from Model Advisor analysis.

example

deselectComponents(app,Name,Value) clears model components specified by Name,Value pair arguments from Model Advisor analysis.

Input Arguments

expand all

Advisor.Application object, created by 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 clear from Model Advisor analysis, as specified by a cell array of IDs

Data Types: cell

Clear 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 Application object, set root analysis, and clear all components from 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);

% Deselect all components
deselectComponents(app);

This example shows how to set the root model, create an Application object, set root analysis, and clear 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);

% Deselect component using IDs
deselectComponents(app,'IDs',RootModel);

Version History

Introduced in R2015b