主要内容

addCopyOfConfiguration

Add copy of existing variant configuration to variant configuration data object

    Description

    Add-On Required: This feature requires the Variant Manager for Simulink add-on.

    addCopyOfConfiguration(varConfigData,ConfigurationName=oldConfig) copies the variant configuration named oldConfig from the Simulink.VariantConfigurationData object varConfigData and adds it to the same object. The function gives the new configuration a default name based on the name of the configuration that is copied.

    addCopyOfConfiguration(varConfigData,ConfigurationName=oldConfig,NewConfigurationName=newConfig) specifies a name for the new configuration.

    example

    Examples

    collapse all

    Open the slexVariantManagement model and get the associated variant configuration data object.

    modelName="slexVariantManagement";
    open_system(modelName);
    varConfigData = Simulink.VariantManager.getConfigurationData("slexVariantManagement");

    Add a copy of the existing variant configuration LinInterExpNoNoise to the variant configuration data object varConfigData and name the copy LinInterExpNoiseGaussian.

    addCopyOfConfiguration(varConfigData,ConfigurationName="LinInterExpNoNoise", ...
     NewConfigurationName="LinInterExpNoiseGaussian");

    Input Arguments

    collapse all

    Variant configuration data to which you want to copy the variant configuration oldConfig, specified as a Simulink.VariantConfigurationData object.

    Name of existing variant configuration to copy, specified as a character vector or string scalar. This configuration must exist in the variant configuration data object varConfigData.

    Example: "LinInterExpNoNoise"

    Data Types: char | string

    Name of the copied configuration, specified as a character vector or string scalar.

    Example: "NonLinExtExpNoise"

    Data Types: char | string

    Version History

    Introduced in R2013b

    expand all