メインコンテンツ

addCopyOfConfiguration

R2026b

Add copy of existing variant configuration to variant configurations object

    Description

    addCopyOfConfiguration(varConfigs,ConfigurationName=oldConfig) copies the variant configuration named oldConfig from the Simulink.VariantConfigurations object varConfigs 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(varConfigs,ConfigurationName=oldConfig,NewConfigurationName=newConfig) specifies a name for the new configuration.

    example

    Examples

    collapse all

    Open the slexVariantManagement model and get the associated variant configurations object.

    modelName="slexVariantManagement";
    open_system(modelName);
    varConfigs = Simulink.VariantManager.getVariantConfigurations("slexVariantManagement");

    Add a copy of the existing variant configuration LinInterExpNoNoise to the variant configurations object varConfigs and name the copy LinInterExpNoiseGaussian.

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

    Input Arguments

    collapse all

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

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

    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