Main Content

Simulink.VariantManager.open

R2026b

Open Variant Manager or Simulink.VariantConfigurations object

Since R2026a

    Description

    Use the Simulink.VariantManager.open function to open Variant Manager programmatically for a Simulink® model. You can also use this function to open the Simulink.VariantConfigurations object dialog box to define and edit variant configurations and constraints without a Simulink model.

    Variant Manager

    Simulink.VariantManager.open(modelOrBlock) opens Variant Manager for the model or block identified by modelOrBlock. The model must be loaded.

    example

    Simulink.VariantManager.open(Model=modelOrBlock) allows you to specify the argument using the Name=Value syntax.

    Variant Configurations Object

    Simulink.VariantManager.open(VariantConfigurations=varConfigsName,Source=src) opens Variant Manager for the Simulink.VariantConfigurations object named varConfigsName that is defined in the data source specified by src.

    example

    Examples

    collapse all

    Open the slexVariantManagement model.

    modelName="slexVariantManagement";
    open_system(modelName);

    Open Simulink® Variant Manager™ for the model by specifying the model name.

    Simulink.VariantManager.open(modelName);

    Open Simulink Variant Manager by specifying a block name in the model.

     Simulink.VariantManager.open("slexVariantManagement/Plant/Internal/VMExperimental");

    Open Simulink Variant Manager by using a Simulink.BlockPath object to specify a block in a referenced model.

     Simulink.VariantManager.open(Simulink.BlockPath({'slexVariantManagement/Plant/Internal/VMExperimental','VMExperimental/Variant Source'}));

    You can specify the input argument directly or as the value of the optional Model parameter using Name=Value syntax.

     Simulink.VariantManager.open(Model="slexVariantManagement/Plant/Internal/VMExperimental");

    Open Variant Configurations Object

    Open the variant configurations object named vcd from the data dictionary topData.sldd. This command opens the Simulink.VariantConfigurations dialog box.

     Simulink.VariantManager.open(VariantConfigurations="vcd",Source="topData.sldd");

    Input Arguments

    collapse all

    Model name or block path, specified as a string, a character vector, or a Simulink.BlockPath object.

    Example: Simulink.VariantManager.open("slexVariantManagement");

    Example: Simulink.VariantManager.open("slexVariantManagement/Plant/Internal/VMExperimental");

    Example: Simulink.VariantManager.open(Simulink.BlockPath({'slexVariantManagement/Plant/Internal/VMExperimental','VMExperimental/Variant Source'}));

    Name of the Simulink.VariantConfigurations object that is present in the data source src, specified as a string or a character vector.

    Data source in which to find the object identified by varConfigsName, specified as one of these values:

    • "caller": The caller workspace is the workspace of the function that invoked the currently running function.

    • "base workspace": MATLAB® base workspace. The base and caller workspaces are equivalent in the context of a function that is invoked from the MATLAB command line.

    • Name of a data dictionary file, specified as a string or a character vector.

    Example: Simulink.VariantManager.open(VariantConfigurations="vcd1",Source="base workspace");

    Example: Simulink.VariantManager.open(VariantConfigurations="vcd1",Source="caller");

    Example: Simulink.VariantManager.open(VariantConfigurations="vcd",Source="topData.sldd");

    Version History

    Introduced in R2026a

    expand all