Using Simulink    

The Parameters Pane

The Parameters pane allows you to create and modify masked subsystem parameters (mask parameters, for short) that determine the behavior of the masked subsystem.

The Parameters pane contains the following elements:

Dialog Parameters Panel

Lists the mask's parameters in tabular form. Each row displays the major attributes of one of the mask's parameters.

Prompt.   Text that identifies the parameter on a masked subsystem's dialog box.

Variable.   Name of the variable that stores the parameter's value in the mask's workspace (see Mask Workspace). You can use this variable as the value of parameters of blocks inside the masked subsystem, thereby allowing the user to set the parameters via the mask dialog box.

Type.   Type of control used to edit the value of this parameter. The control appears on the mask's parameter dialog box following the parameter prompt. The button that follows the type name in the Parameters pane pops up a list of the controls supported by Simulink (see Control Types). To change the current control type, select another type from the list.

Evaluate.   If checked, this option causes Simulink to evaluates the expression entered by the user before it is assigned to the variable. Otherwise Simulink treats the expression itself as a string value and assigns it to the variable. For example, if the user enters the expression gain in an edit field and the Evaluate option is checked, Simulink evaluates gain and assigns the result to the variable. Otherwise, Simulink assigns the string 'gain' to the variable. See Check Box Control and Pop-Up Control for information on how this option affects evaluation of the parameters.

If you need both the string entered and the evaluated value, uncheck the Evaluate option. Then use the MATLAB eval command in the initialization commands. For example, if LitVal is the string 'gain', then to obtain the evaluated value, use the command

Tunable.   Selecting this option allows a user to change the value of the mask parameter while a simulation is running.

Options for Selected Parameter Panel

This panel allows you to set additional options for the parameter selected in the Dialog parameters table.

Show parameter.   The selected parameter appears on the masked block's parameter dialog box only if this option is checked (the default).

Enable parameter.   Unchecking this option greys the selected parameter's prompt and disables its edit control. This means that the user cannot set the value of the parameter.

Popups.   This field is enabled only if the edit control for the selected parameter is a pop-up. Enter the values of the pop-up control in this field, each on a separate line.

Callback.   Enter MATLAB code that you want Simulink to execute when a user edits the selected parameter. The callback can create and reference variables only in the block's base workspace. If the callback needs the value of a mask parameter, it can use get_param to obtain the value, e.g.,

Parameter Buttons

The following sections explain the purpose of the buttons that appear on the Parameter pane in the order of their appearance from the top of the pane.

Add Button.   Adds a parameter to the mask's parameter list. The newly created parameter appears in the adjacent Dialog parameters table.

Delete Button.   Deletes the parameter currently selected in the Dialog parameters table.

Up Button.   Moves the currently selected parameter up one row in the Dialog parameters table. Dialog parameters appear in the mask's parameter dialog box (see Mask Parameter Dialog Box) in the same order in which they appear in the Dialog parameters table. This button (and the next) thus allows you to determine the order in which parameters appear on the dialog box.

Down Button.   Moves the currently selected parameter down one row in the Dialog parameters table and hence down one position on the mask's parameter dialog box.


  The Icon Pane Control Types