| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Real-Time Workshop |
| Contents | Index |
| Learn more about Real-Time Workshop |
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.
Note The Model Parameter Configuration dialog box cannot tune parameters within referenced models. See Parameterizing Model References for tuning techniques that work with referenced models. |
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:
The Source list panel displays a list of workspace variables and lets you add them to the tunable parameters list.
The Global (tunable) parameters panel displays and maintains a list of tunable parameters associated with the model.
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.
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.
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
Storage class of the parameter in the generated code. Select one of
SimulinkGlobal (Auto)
ExportedGlobal
ImportedExtern
ImportedExternPointer
See Tunable Parameter Storage Classes for definitions.
Storage type qualifier of the variable in the generated code. For variables with any storage class except SimulinkGlobal (Auto), you can add a qualifier (such as const or volatile) to the generated storage declaration. To do so, you can select a predefined qualifier from the list or add additional qualifiers to the list. The code generator does not check the storage type qualifier for validity. The code generator includes the qualifier string in the generated code without syntax checking.
Name of the parameter. This field is used only when creating a new tunable variable.
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.
Note If you edit the name of an existing variable in the list, you actually create a new tunable variable with the new name. The previous variable is removed from the list and loses its tunability (that is, it is inlined). |
To declare an existing variable tunable
In the Source list panel, click the desired variable in the list to select it.
Click the Add to table button. The variable then appears in the table of tunable variables in the Global (tunable) parameters panel.
Click the variable in the Global (tunable) parameters panel.
Select the desired storage class from the Storage class menu.
Optionally, select (or enter) a storage type qualifier, such as const or volatile that you want the variable to have.
Click Apply, or click OK to apply changes and close the dialog box.
![]() | Tunable Parameter Storage Classes | Tunable Expressions | ![]() |

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 |