Main Content

removeComponentConfiguration

Remove association between variant configurations of top-level model and referenced model

Since R2022b

    Description

    In a model that has predefined variant configurations and also has a referenced model in its model hierarchy, the referenced model can define its own variant configurations. While authoring the variant configurations for the top-level model, you can associate a referenced model configuration with a top-level variant configuration to populate the corresponding control variables in the top-level configuration. Use the removeComponentConfiguration function to remove this association. For more information, see Compose Variant Configurations and Constraints for Top Model Using Referenced Component Configurations.

    Note

    This function requires Variant Manager for Simulink®.

    removeComponentConfiguration(vcdtop,ConfigurationName=topconfig,ComponentName=refmdl) removes an existing association between a variant configuration of the referenced model refmdl and the top-level variant configuration topconfig that is present in the variant configuration data object vcdtop. This operation also makes variant control variables in topconfig populated using the referenced model configuration writeable. You can modify these variables in topconfig independently of their values in the referenced model configuration.

    example

    Examples

    collapse all

    The slexVariantManagement model, which is associated with the variant configuration object vcd, has a referenced model named slexVariantManagementExternalPlantMdlRef in its hierarchy that uses a predefined variant configuration named LowFid. Disassociate LowFid from the variant configuration named NonLinExterLowFid present in vcd.

    modelname = "slexVariantManagement";
    openExample(modelname);
    vcd = Simulink.VariantManager.getConfigurationData(modelname);
    removeComponentConfiguration...
     (vcd,ConfigurationName="NonLinExterLowFid",...
     ComponentName="slexVariantManagementExternalPlantMdlRef");

    Input Arguments

    collapse all

    Variant configuration data of the top-level model, specified as a Simulink.VariantConfigurationData object.

    Name of the top-level variant configuration present in vcdtop to disassociate the referenced component configuration from, specified as a character vector or string scalar.

    Example: "LinInterExpNoNoise"

    Data Types: char | string

    Name of the referenced component, such as a referenced model, specified as a character vector or string scalar.

    Example: "slexVariantManagementExternalPlantMdlRef"

    Data Types: char | string

    Version History

    Introduced in R2022b

    expand all