Main Content

selectCheckInstances

Class: Advisor.Application
Namespace: 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 can change. To obtain the check instance ID, use the getCheckInstanceIDs method.

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

example

selectCheckInstances(app,'IDs',checkInstanceIDs) selects check instances specified by checkInstanceIDs 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.

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.

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

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

% 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 "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);

Version History

Introduced in R2015b