Main Content

delete

Delete check and folder instances from configuration

Since R2024b

Description

delete(CfgObj,CheckInstanceID) deletes the specified check instance CheckInstanceID from the Model Advisor configuration accessed by the CfgObj object.

example

delete (CfgObj,FolderInstanceID) deletes the specified folder instance FolderInstanceID and the checks in it.

Examples

collapse all

Delete check instances from a configuration file, myCustomFile.json, located in your working directory

Create a Model Advisor configuration object.

CfgObj = Advisor.Config;

Load the existing configuration file myCustomFile.json.

loadConfig(CfgObj,'myCustomFile.json');

Add the checks with ID mathworks.jmaab.jc_0231 under the root node.

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

Create a new folder named myFolder under the root node and add the check with ID mathworks.jmaab.jc_0222 into it.

FolderInstanceID = addFolder(CfgObj,'_SYSTEM','myFolder');

CheckInstanceID1 = addCheck(CfgObj,'_SYSTEM_myFolder','mathworks.jmaab.jc_0222');

To delete the check mathworks.jmaab.jc_0231 located in the root node, use this code.

delete(CfgObj,'_SYSTEM_mathworks.jmaab.jc_0231');

To delete the myFolder folder and the check in it, use this code.

delete(CfgObj,'_SYSTEM_myFolder');

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 the 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"

Alternative Functionality

App

You can also use the Model Advisor Configuration Editor to modify existing configurations and create new configurations. In the Model Advisor Configuration Editor, to delete a check or folder, click the Delete button. For more information, see Use Model Advisor Configuration Editor to Customize Model Advisor.

Version History

Introduced in R2024b