Documentation Center

  • Trial Software
  • Product Updates

Manage a Configuration Set

Create a Configuration Set in a Model

  1. Open the Model Explorer.

  2. In the Model Hierarchy pane, select the model name.

  3. You can create a new configuration set in any of the following ways:

    • From the Add menu, select Configuration.

    • On the toolbar, click the Add Configuration button .

    • In the Model Hierarchy pane, right-click an existing configuration set and copy and paste the configuration set.

Create a Configuration Set in the Base Workspace

  1. Open the Model Explorer.

  2. In the Model Hierarchy pane, select Base Workspace.

  3. You can create a new configuration set object in the following ways:

    • From the Add menu, select Configuration

    • In the toolbar, click the Add Configuration button

  4. The configuration set object appears in the Contents pane, with the default name, ConfigSet.

Open a Configuration Set in the Configuration Parameters Dialog Box

In the Model Explorer, to open the Configuration Parameters dialog box for a configuration set, right-click the configuration set's node to display the context menu, then select Open. You can open the Configuration Parameters dialog box for any configuration set, whether or not it is active.

The title bar of the dialog box indicates whether the configuration set is active or inactive.

    Note:   Every configuration set has its own Configuration Parameters dialog box. As you change the state of a configuration set, the title bar of the dialog box changes to reflect the state.

Activate a Configuration Set

Only one configuration set associated with a model is active at any given time. The active set determines the current values of the model parameters. You can change the active or inactive set at any time (except when executing the model). In this way, you can quickly reconfigure a model for different purposes, for example, testing and production, or apply standard configuration settings to new models.

To activate a configuration set, right-click the configuration set node to display the context menu, then select Activate.

Set Values in a Configuration Set

To set the value of a parameter in a configuration set, in the Model Explorer:

  1. In the Model Hierarchy, select the configuration set node.

  2. In the Contents pane, select the component from where the parameter resides.

  3. In the Dialog pane, edit the parameter value.

Copy, Delete, and Move a Configuration Set

You can use edit commands on the Model Explorer Edit or context menus or object drag-and-drop operations to delete, copy, and move configuration sets among models displayed in the Model Hierarchy pane.

For example, to copy a configuration set from one model to another:

  1. In the Model Hierarchy pane, right-click the configuration set node that you want to copy.

  2. Select Copy in the configuration set context menu.

  3. Right-click the model node in which you want to create the copy.

  4. Select Paste from the model context menu.

To copy the configuration set using object drag-and-drop, hold down the right mouse button and drag the configuration set node to the node of the model in which you want to create the copy.

To move a configuration set from one model to another using drag-and-drop, hold the left mouse button down and drag the configuration set node to the node of the destination model.

    Note   You cannot move or delete an active configuration set from a model.

Save a Configuration Set

You can save the settings of configuration sets as MATLAB® functions or scripts. Using the MATLAB function or script, you can share and archive model configuration sets. You can also compare the settings in different configuration sets by comparing the MATLAB functions or scripts of the configuration sets.

To save an active or inactive configuration set from the Model Explorer:

  1. Open the model.

  2. Open the Model Explorer.

  3. Save the configuration set:

    1. In the Model Hierarchy pane:

      • Right-click the model node and select Configuration > Export Active Configuration Set.

      • Right-click a configuration set and select Export.

      • Select the model. In the Contents pane, right-click a configuration set and select Export.

    2. In the Export Configuration Set to File dialog box, specify the name of the file and the file type. If you specify a .m extension, the file contains a function that creates a configuration set object. If you specify a .mat extension, the file contains a configuration set object.

        Note:   Do not specify the name of the file to be the same as a model name. If the file and model have the same name, the software cannot determine which file contains the configuration set object when loading the file.

    3. Click Save. The Simulink® software saves the configuration set.

Load a Saved Configuration Set

You can load configuration sets that you previously saved as MATLAB functions or scripts.

To load a configuration set from the Model Explorer:

  1. Open the model.

  2. Open the Model Explorer.

  3. In the Model Hierarchy pane, right-click the model and select Configuration > Import.

  4. In the Import Configuration Set From File dialog box, select the .m file that contains the function to create the configuration set object, or the .mat file that contains the configuration set object.

  5. Click Open. The Simulink software loads the configuration set.

      Note:   If you load a configuration set object that contains an invalid custom target, the software sets the System target file parameter to ert.tlc.

  6. Optionally, activate the configuration set. For more information, see Activate a Configuration Set.

Copy Configuration Set Components

To copy a configuration set component from one configuration set to another:

  1. Select the component in the Model Explorer Contents pane.

  2. From either the Model Explorer Edit menu or the component context menu, select Copy.

  3. Select the configuration set into which you want to copy the component.

  4. From either the Model Explorer Edit menu or the component context menu, select Paste.

      Note   The copy replaces the component of the same name in the destination configuration set. For example, if you copy the Solver component of configuration set A and paste it into configuration set B, the copy replaces the existing Solver component in B.

Was this topic helpful?