Products & Services Solutions Academia Support User Community Company

Learn more about Real-Time Workshop   

Using the Model Parameter Configuration Dialog Box

The Model Parameter Configuration dialog box is available only when the Inline parameters check box on the Optimization pane is selected. Selecting this check box activates the Configure button, as shown in the next figure.

Clicking the Configure button opens the Model Parameter Configuration dialog box.

The Model Parameter Configuration Dialog Box

The Model Parameter Configuration dialog box lets you select base workspace variables and declare them to be tunable parameters in the current model. The dialog box is divided into two panels:

To declare tunable parameters, you select one or more variables from the Source list, add them to the Global (tunable) parameters list, and set their storage class and other attributes.

Source List Panel

The Source list panel displays a menu and a scrolling table of numerical workspace variables.

The menu lets you choose the source of the variables to be displayed in the list. There are two choices: MATLAB workspace (lists all variables in the MATLAB workspace that have numeric values), and Referenced workspace variables (lists only those variables referenced by the model). The source list displays names of variables defined in the MATLAB base workspace.

Selecting one or more variables from the source list enables the Add to table button. Clicking Add to table adds selected variables to the tunable parameters list in the Global (tunable) parameters panel. This action is all that is necessary to declare tunable parameters. However, if a block parameter which is not tunable is set to the name that appears on this list, a warning results during simulation and also during code generation.

In the Source list, the names of variables added to the tunable parameters list are displayed in bold type (see the preceding figure).

The Refresh list button updates the table of variables to reflect the current state of the workspace. If you define or remove variables in the workspace while the Model Parameter Configuration dialog box is open, click the Refresh list button when you return to the dialog box. The new variables are added to the source list.

Global (Tunable) Parameters Panel

The Global (tunable) parameters panel displays a scrolling table of variables that have been declared tunable in the current model and lets you specify their attributes. The Global (tunable) parameters panel also lets you remove entries from the list or create new tunable parameters.

You select individual variables and change their attributes directly in the table. The attributes are

Use the New button to create a new tunable variable entry in the Global (tunable) parameters list. Enter the name and attributes of the variable and click Apply. The new variable does not need to be in use when you do this. At a later time, you can add references to any such variable in the model.

If the name you enter matches the name of an existing workspace variable in the Source list, that variable is declared tunable and appears in italics in the Source list.

Use the Remove button to delete selected variables from the Global (tunable) parameters list. All removed variables are inlined if Inlined parameters is on.

Declaring Tunable Variables

To declare an existing variable tunable

  1. Open the Model Parameter Configuration dialog box.

  2. In the Source list panel, click the desired variable in the list to select it.

  3. Click the Add to table button. The variable then appears in the table of tunable variables in the Global (tunable) parameters panel.

  4. Click the variable in the Global (tunable) parameters panel.

  5. Select the desired storage class from the Storage class menu.

  6. Optionally, select (or enter) a storage type qualifier, such as const or volatile that you want the variable to have.

  7. Click Apply, or click OK to apply changes and close the dialog box.

  


Related Products & Applications

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

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