主要内容

getVariantConfiguration

R2026b

Get specific variant configuration from variant configurations object

Renamed from getConfiguration in R2026b

    Description

    variantConfig = getVariantConfiguration(varConfigs,ConfigurationName=nameOfConfig) returns the variant configuration named nameOfConfig from the Simulink.VariantConfigurations object varConfigs.

    example

    Examples

    collapse all

    Open the model slexVariantReducer.

    modelName = "slexVariantReducer";
    open_system(modelName);

    Get the variant configuration named config1 from the variant configurations object associated with the model.

    varConfigs = Simulink.VariantManager.getVariantConfigurations(modelName);
    getVariantConfiguration(varConfigs,ConfigurationName="config1")
    ans = struct with fields:
                    Name: 'config1'
             Description: ''
        ControlVariables: [1×2 struct]
    
    

    Input Arguments

    collapse all

    Variant configurations object from which you want to get the specified configuration, specified as a Simulink.VariantConfigurations object.

    Name of the variant configuration to be returned, specified as a character vector or string scalar.

    Example: "LinInterExpNoNoise"

    Data Types: char | string

    Output Arguments

    collapse all

    Variant configuration, returned as a structure with these fields.

    FieldTypeDescription
    Namechar

    Name of the configuration.

    Descriptionchar

    Description of the configuration.

    ControlVariablesstruct

    Variant control variable names and their values, returned as a structure.

    Version History

    Introduced in R2013b

    expand all