Main Content

getPreferredConfiguration

Get name of preferred variant configuration for variant configuration data object

Since R2022b

    Description

    Note

    This function requires Variant Manager for Simulink®.

    configname = getPreferredConfiguration(varconfigdata) gets the name of the preferred variant configuration for the Simulink.VariantConfigurationData object varconfigdata.

    example

    Examples

    collapse all

    Open the model slexVariantManagement.

    model = "slexVariantManagement";
    open_system(model);

    Get the variant configuration data object associated with the model.

    varconfigdata = Simulink.VariantManager.getConfigurationData(model);

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

    configname = getPreferredConfiguration(varconfigdata);

    Input Arguments

    collapse all

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