Main Content

selectCheckInstances

Class: Advisor.Application
Package: Advisor

Select check instances to use in Model Advisor analysis

Description

You can select check instances to use in a Model Advisor analysis. A check instance is an instantiation of a ModelAdvisor.Check object in the Model Advisor configuration. When you change the Model Advisor configuration, the check instance ID might change. To obtain the check instance ID, use the getCheckInstanceIDs method.

example

selectCheckInstances(app) selects all check instances to use for Model Advisor analysis.

example

selectCheckInstances(app,Name,Value) selects check instances specified by Name,Value pair arguments to use for Model Advisor analysis.

Input Arguments

expand all

Advisor.Application object, created by Advisor.Manager.createApplication

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Select check instances to use in Model Advisor analysis, as specified as a cell array of IDs

Data Types: cell

Examples

expand all

This example shows how to set the root model, create an Application object, set root analysis, and select all check instances for Model Advisor analysis.

% 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 checks
selectCheckInstances(app);

This example shows how to set the root model, create an Application object, set root analysis, and select a check using instance ID.

% 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 "Identify unconnected lines, input ports, and output 
% ports" check using check instance ID
instanceID = getCheckInstanceIDs(app,'mathworks.design.UnconnectedLinesPorts');
checkinstanceID = instanceID(1);
selectCheckInstances(app,'IDs',checkinstanceID);
Introduced in R2015b