Contenuto principale

Simulink.VariantManager.open

Open Variant Manager or Simulink.VariantConfigurationData object

Since R2026a

    Description

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

    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.VariantConfigurationData 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 Configuration Data Object

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

    example

    Examples

    collapse all

    Open the slexVariantManagement model.

    modelName="slexVariantManagement";
    open_system(modelName);

    Open Variant Manager for the model by specifying the model name.

    Simulink.VariantManager.open(modelName);

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

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

    Open 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 Configuration Data Object

    Open the variant configuration data object named vcd from the data dictionary topData.sldd. This command opens the Simulink.VariantConfigurationData 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.VariantConfiguraionData 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 varConfigDataName, 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