主要内容

getConfiguration

Get specific variant configuration from variant configuration data object

    Description

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

    variantConfig = getConfiguration(varConfigData,ConfigurationName=nameOfConfig) returns the variant configuration named nameOfConfig from the Simulink.VariantConfigurationData object varConfigData.

    example

    Examples

    collapse all

    Open the model slexVariantReducer.

    modelName = "slexVariantReducer";
    open_system(modelName);

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

    varConfigData = Simulink.VariantManager.getConfigurationData(modelName);
    getConfiguration(varConfigData,ConfigurationName="config1")
    ans = struct with fields:
                          Name: 'config1'
                   Description: ''
              ControlVariables: [1×2 struct]
        SubModelConfigurations: [1×0 struct]
    
    

    Input Arguments

    collapse all

    Variant configuration data from which you want to get the specified configuration, specified as a Simulink.variantConfigurationData 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