Main Content

isSelected

Determine if check and folder instances are selected in configuration

Since R2024b

Description

value = isSelected(CfgObj,CheckInstanceID) returns logical 1 (true) if the specified check instance is selected in the Model Advisor configuration accessed by the CfgObj object. Otherwise, it returns 0 (false). The selected check instances are included in the Model Advisor analysis.

example

value = isSelected(CfgObj,FolderInstanceID) returns logical 1 (true) if the specified folder instance is included in the Model Advisor analysis, and 0 (false) otherwise.

Examples

collapse all

Consider an existing configuration file myCustomFile.json is located in your working directory. This example shows how to check whether a specific check instance is selected to be included in the Model Advisor analysis.

Create a Model Advisor configuration object.

CfgObj = Advisor.Config;

Load the existing configuration file myCustomFile.json.

loadConfig(CfgObj,'myCustomFile.json');

Add the checks with IDs mathworks.jmaab.jc_0231 and mathworks.jmaab.jc_0222 under the root node.

addCheck(CfgObj,'_SYSTEM','mathworks.jmaab.jc_0231');
addCheck(CfgObj,'_SYSTEM','mathworks.jmaab.jc_0222');

Check whether the check mathworks.jmaab.jc_0231 located in the root node is included in the Model Advisor analysis.

value = isSelected(CfgObj,'_SYSTEM_mathworks.jmaab.jc_0231')
value =

  logical

   1

Input Arguments

collapse all

Model Advisor configuration object, specified as an Advisor.Config object.

By default, after creation, the object provides you access to an editable blank configuration that you can use to create a new custom configuration. To customize an existing configuration, load the configuration JSON file as the active configuration by using loadConfig.

Check instance ID, specified as a character vector or string scalar. The instance ID represents the location of the check in the configuration in this form _SYSTEM_Check Hierarchy_Check ID.

Example: '_SYSTEM_By Product_mathworks.jmaab.ar_0001'

Folder instance ID, specified as a character vector or string scalar. The instance ID represents the location of the folder in the configuration in the form _SYSTEM_Folder Hierarchy.

Example: '_SYSTEM_By Product'

Output Arguments

collapse all

Instance status, returned as a boolean. If the returned value is true, the specified check or folder instance is included in the Model Advisor analysis.

Version History

Introduced in R2024b