Using Simulink Previous page   Next Page

Activating a Configuration Set

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

Copying, Deleting, and Moving Configuration Sets

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

For example, to copy a configuration set, using edit commands:

  1. Select the configuration set that you want to copy in the Model Hierarchy pane.
  2. Select Copy from the Model Explorer's Edit menu or the configuration set's context menu or press Ctrl+C.
  3. Select the model in which you want to create the copy

  1. Select Paste from the Model Explorer's Edit menu or from the model's context menu or press Ctrl+V.

To copy the configuration set, using object drag-and-drop, hold the Ctrl key and the right mouse button down and drag the configuration set's 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 Ctrl key and the left mouse button down and drag the configuration set's node to the node of the destination model.

Copying Configuration Set Components

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

  1. Select the component in the Model Explorer's Contents pane.
  2. Select Copy from the Model Explorer's Edit menu or the component's context menu or press Ctrl+C.
  3. Select the configuration set into which you want to copy the component.
  4. Select Paste from the Model Explorer's Edit menu or the component's context menu or press Ctrl+C.

Creating Configuration Sets

To create a new configuration set, copy an existing configuration set.

Setting Values in Configuration Sets

To set the value of a parameter in a configuration set, select the configuration set in the Model Explorer and then edit the value of the parameter on the corresponding dialog in the Model Explorer's dialog view.

Configuration Set API

Simulink provides an application program interface (API) that permits you to create and manipulate configuration sets from the command line or in a MAT-file or M-file. The API includes the Simulink.ConfigSet data object class and the following model construction commands:

These commands, along with the methods and properties of Simulink.ConfigSet class, allows an M-file program to create and modify configuration sets, attach configuration sets to a model, and set a model's active configuration set. For example, to create a configuration set from scratch at the command line, enter

The default name of the new configuration set is Configuration. To change the name, execute

where name is the set's new name.

Use get_param and set_param to get and set the value of a parameter in a configuration set. For example, to specify the Simulink fixed-step discrete solver in the configuration set, execute

To save the configuration set in a MAT-file, execute

where mat_file is the name of the MAT-file. To load the configuration set, execute

To prevent or allow a user to change the value of a parameter in a configuration set, execute

where param is the name of the parameter. To attach a configuration set to a model, execute

where model is the model name (in quotes) or object. To get a model's active configuration set, execute

To get a configuration set's full name (e.g., engine/Configuration), execute

To set a model's active set, execute

where cfg_set is the configuration set's name in quotes.


Previous page  Configuration Sets The Model Configuration Dialog Box Next page

© 1994-2005 The MathWorks, Inc.