| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
| On this page… |
|---|
Activating a Configuration Set Copying, Deleting, and Moving Configuration Sets Copying Configuration Set Components Loading Saved Configuration Sets Setting Values in Configuration Sets |
A configuration set is a named set of values for a model's parameters, such as solver type and simulation start or stop time. Every new model is created with a default configuration set, called Configuration, that initially specifies default values for the model's parameters. You can subsequently create and modify additional configuration sets and associate them with the model. The sets associated with a model can specify different values for any or all configuration parameters.
This section describes techniques for defining and using configuration sets that are stored in individual models. Such configuration sets are available only to the model that contains them. The next section, Referencing Configuration Sets, describes techniques for storing configuration sets in the base workspace, independently of any model. Such configuration sets can be shared by any number of models.
A configuration set comprises groups of related parameters called components. Every configuration set includes the following components:
Solver
Data Import/Export
Optimization
Diagnostics
Hardware Implementation
Model Referencing
Simulation Target
Some Simulink-based products, such as Real-Time Workshop, define additional components. If such a product is installed on your system, the configuration set also contains the components that it defines.
Only one of the configuration sets associated with a model is active at any given time. The active set determines the current values of the model's parameters. Changing the value of a parameter in the Model Explorer changes its value in the associated configuration set. 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, e.g., testing and production, or apply standard configuration settings to new models.
To display the configuration sets associated with a model, open the Model Explorer (see The Model Explorer: Overview). The configuration sets associated with the model appear as gear-shaped nodes in the Model Explorer's Model Hierarchy pane.

The Model Explorer's Contents pane displays the components of the selected configuration set. The Model Explorer's Dialog pane displays a dialog box for setting the parameters of the selected group (see Configuration Parameters Dialog Box).
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.
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 node's context menu, then select Open from the context menu. You can open the Configuration Parameters dialog box for any configuration set, whether or not it is active. You might want to open a configuration set to inspect or edit the parameter settings.
The title bar of the dialog box indicates if 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 top-left corner label changes to reflect the state. |
You can use edit commands on the Model Explorer's Edit or context menus or object drag-and-drop operations to delete, copy, and move configuration sets among models displayed in the Model Explorer's Model Hierarchy pane.
For example, to copy a configuration set, using edit commands:
Select the model with a configuration set that you want to copy in the Model Hierarchy pane.
Select the configuration set that you want to copy in the Contents pane.
Select Copy from the Model Explorer's Edit menu or the configuration set's context menu.
Select Paste from the Model Explorer's Edit menu or from the model's context menu.
To copy the configuration set, using object drag-and-drop, hold 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 left mouse button down and drag the configuration set's node to the node of the destination model.
To copy a configuration set component from one configuration set to another:
Select Copy from the Model Explorer's Edit menu or the component's context menu.
Select the configuration set into which you want to copy the component.
Select Paste from the Model Explorer's Edit menu or the component's context menu.
To create a new configuration set, select Configuration
Set from the Model Explorer's Add menu
or press the Add Configuration button
in the Model Explorer's
toolbar. You can also create a new configuration set by copying an
existing 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 a configuration set as a MATLAB function or script:
Use getActiveConfigSet or getConfigSet to get a handle to the configuration set.
Use the saveAs method of the Simulink.Configset class to save the configuration set as a function or script.
You can load configuration sets that you previously saved as MATLAB functions or scripts.
To load a configuration set from a MATLAB function or script:
Use getActiveConfigSet or getConfigSet to get a handle to the configuration set that you want to update.
Call the MATLAB function or execute the MATLAB script to load the saved configuration set.
Use attachConfigSet to attach the configuration set to the model. To avoid configuration set naming conflicts, set allowRename to true.
Activate the configuration set. For more information, see Activating a Configuration Set.
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 box in the Model Explorer's dialog view.
An application program interface (API) lets you create and manipulate configuration sets from the command line or in a MAT-file or MATLAB-file. The API includes the Simulink.ConfigSet data object class and the following functions:
These functions, along with the methods and properties of Simulink.ConfigSet class, allow you to create a MATLAB-file program to:
Create and modify configuration sets.
Attach configuration sets to a model.
Set the active configuration set for a model.
Open and close configuration sets.
Detach configuration sets from a model.
For examples using the above functions and the Simulink.ConfigSet class, see the function and class reference pages.
The Model Configuration dialog box appears in the Model Explorer dialog pane when you select any model configuration.

You can edit the name and description of your configuration. See Model Configuration Pane.
The Model Configuration Preferences dialog box appears in the Model Explorer dialog pane when you view the default model configuration.
Enable View > Show Configuration Preferences in the Model Explorer menu.
Select Configuration Preferences under the Simulink Root node in the Model Explorer Model Hierarchy pane.
You can also edit the configuration defaults in the Simulink Preferences window. See Model Configuration Pane.
![]() | Managing Configuration Sets | Referencing Configuration Sets | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2010- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |