Contenido principal

removeReferencedConfiguration

R2026b

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

Renamed from removeComponentConfiguration in R2026b

    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 removeReferencedConfiguration function to remove this association. For more information, see Compose Variant Configurations and Constraints for Top Model Using Referenced Configurations.

    removeReferencedConfiguration(vcoTop,ConfigurationName=topConfig,ReferencedComponentName=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 configurations object vcoTop. This operation also makes variant control variables in topConfig populated using the referenced model configuration writable. You can modify these variables in topConfig independently of their values in the referenced model configuration.

    example

    Examples

    collapse all

    Open the slexVariantManagement model.

    modelName = "slexVariantManagement";
    open_system(modelName);

    The slexVariantManagement model, which is associated with the variant configurations object vco, 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 vco.

    vco = Simulink.VariantManager.getVariantConfigurations(modelName);
    removeReferencedConfiguration(vco,ConfigurationName="NonLinExterLowFid", ...
        ReferencedComponentName="slexVariantManagementExternalPlantMdlRef");

    Input Arguments

    collapse all

    Variant configurations object of the top-level model, specified as a Simulink.VariantConfigurations object.

    Name of the top-level variant configuration present in vcoTop 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