Skip to Main Content Skip to Search
Product Documentation

Manage a Configuration Reference

Create and Attach a Configuration Reference

To use a configuration reference, it must point to freestanding configuration set. Create a freestanding configuration set before creating a configuration reference, see Create a Configuration Set in the Base Workspace.

To create a configuration reference:

  1. In the Model Explorer, in the Model Hierarchy pane, select the model.

  2. Click the Add Reference tool or select Add > Configuration Reference. The Create Configuration Reference dialog box opens.

  3. Specify the Configuration set name of the configuration set object in the base workspace to be referenced.

  4. Click OK. If you chose to create a configuration reference without first creating a configuration set object, a dialog box opens asking if you would like to continue. If you choose:

  5. A new configuration reference appears in the Model Hierarchy under the selected model. The default name of the new reference is Reference.

Resolve a Configuration Reference

An unresolved configuration reference is a configuration reference that is not pointing to a valid configuration set object.

To resolve a configuration reference:

  1. In the Model Hierarchy pane, select the unresolved configuration reference or right-click the configuration reference, and select Open from the context menu.

    The Configuration Reference dialog box opens in the Dialog pane or a separate window.

  2. Specify the Referenced configuration set to be a configuration set object already in the base workspace. If one does not exist, see Create a Configuration Set in the Base Workspace.

      Tip   Do not specify the name of a configuration reference. If you nest a configuration reference, an error occurs.

  3. Click OK or Apply.

    If you specified a Referenced configuration that exists in the base workspace, the Is Resolved field in the dialog box changes to yes.

Activate a Configuration Reference

After you create a configuration reference and attach it to a model, you can activate it so that it is the active configuration.

When a configuration reference is active, the Is Active field of the Configuration Reference dialog box changes to yes. Also, the Model Explorer shows the name of the reference with the suffix (Active).

The freestanding configuration set of the active reference now provides the configuration parameters for the model.

Change Parameter Values in a Referenced Configuration Set

To obtain a referenced configuration set:

  1. In the Model Hierarchy pane, select the configuration reference, or right-click the configuration reference, and select Open from the context menu.

    The Configuration Reference dialog box appears in the Dialog pane or in a separate window.

  2. To the right of the Referenced configuration field, click Open. The Configuration Parameters dialog box opens. You can now change and apply parameter values as you would for any configuration set.

Save a Referenced Configuration Set

If your model uses a configuration reference to specify the model configuration, before closing your model, you need to save the referenced configuration set to a MAT-file or MATLAB script.

  1. In the Model Explorer, in the Model Hierarchy, select Base Workspace.

  2. In the Contents pane, right-click the name of the referenced configuration set.

  3. From the context menu, select Export Selected.

  4. Specify the filename for saving the configuration set as either a MAT-file or a MATLAB script.

Load a Saved Referenced Configuration Set

If your model uses a configuration reference to specify the model configuration, you need to load the referenced configuration set from a MAT-file or MATLAB script to the base workspace.

  1. In the Model Explorer, in the Model Hierarchy, right-click Base Workspace.

  2. From the context menu, select Import.

  3. Specify the filename for the saved configuration set and select OK. The configuration set object appears in the base workspace.

Why is the Build Button Not Available for a Configuration Reference?

The Code Generation pane of the Configuration Parameters dialog box contains a Build button. Its availability depends on whether the configuration set displayed by the dialog box resides in a model or is a freestanding configuration set.

To provide the same capabilities whether a configuration set resides in a model or is freestanding, the Configuration Reference dialog box contains a Build button. This button has the same capability as its equivalent in the Configuration Parameters dialog box. It operates on the model that contains the configuration reference.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS