Contenido principal

getPreferredConfiguration

R2026b

Get name of preferred variant configuration for variant configurations object

Since R2022b

    Description

    configName = getPreferredConfiguration(varConfigs) gets the name of the preferred variant configuration for the Simulink.VariantConfigurations object varConfigs.

    example

    Examples

    collapse all

    Open the model slexVariantManagement.

    model = "slexVariantManagement";
    open_system(model);

    Get the variant configurations object associated with the model.

    varConfigs = Simulink.VariantManager.getVariantConfigurations(model);

    Get the name of the preferred variant configuration for the variant configurations object.

    configName = getPreferredConfiguration(varConfigs);

    Input Arguments

    collapse all

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

    Output Arguments

    collapse all

    Name of the preferred variant configuration, returned as a character vector or string scalar.

    Data Types: char | string

    Version History

    Introduced in R2022b

    expand all