Main Content

addFolder

Create new folders in configuration

Since R2024b

    Description

    FolderInstanceID = addFolder(CfgObj,ParentFolderID,FolderName) creates a new folder, FolderName, under the chosen parent folder of the Model Advisor configuration accessed by the CfgObj object. The newly created folder is selected to be included in the Model Advisor analysis. If you want to exclude the folder from the analysis, use the deselect function.

    example

    FolderInstanceID = addFolder(CfgObj,ParentFolderID) creates a folder named New Folder and appends the count of folders with the same base name.

    Examples

    collapse all

    Create new folders in an existing configuration file, myCustomFile.json, which is located in your working directory.

    Create a Model Advisor configuration object.

    CfgObj = Advisor.Config;

    Load the myCustomFile.json file.

    loadConfig(CfgObj,'myCustomFile.json');

    Create a new folder named My Folder under the root node.

    addFolder(CfgObj,'_SYSTEM','My Folder')

    The addFolder function returns the instance ID of the new folder.

    ans = 
        '_SYSTEM_My Folder'

    Input Arguments

    collapse all

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

    By default, after creation, the object provides you access to a 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.

    Instance ID of the parent folder, specified as a character vector or string scalar.

    The instance ID of the parent folder represents the location of the folder in the configuration where you want to create a new folder. The instance ID represents the location of the folder in the form _SYSTEM_Folder Hierarchy. _SYSTEM is the instance ID of the root node.

    For example, the instance ID of the Simulink folder, which is located under the By Product folder in the root node, is _SYSTEM_By Product_Simulink.

    Example: "_SYSTEM_By Product_Simulink"

    Data Types: char | string

    New folder name, specified as a character vector or string scalar.

    Example: "My Folder"

    Output Arguments

    collapse all

    Instance ID of the new folder, specified as a character vector. The instance ID represents the folder location in the configuration.

    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, use New Folder button to create a folder. For more information, see Use Model Advisor Configuration Editor to Customize Model Advisor.

    Version History

    Introduced in R2024b