Using Simulink    

Prompts and Associated Variables

A prompt provides information that helps the user enter or select a value for a block parameter. Prompts appear on the mask dialog box in the order they appear in the Prompt list.

When you define a prompt, you also specify the variable that is to store the parameter value, choose the style of control for the prompt, and indicate how the value is to be stored in the variable.

If the Assignment type is Evaluate, the value entered by the user is evaluated by MATLAB before it is assigned to the variable. If the type is Literal, the value entered by the user is not evaluated, but is assigned to the variable as a string.

For example, if the user enters the string gain in an edit field and the Assignment type is Evaluate, the string gain is evaluated by MATLAB and the result is assigned to the variable. If the type is Literal, the string is not evaluated by MATLAB so the variable contains the string 'gain'.

If you need both the string entered as well as the evaluated value, choose Literal. 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

In general, most parameters use an Assignment type of Evaluate.

Creating the First Prompt

To create the first prompt in the list, enter the prompt in the Prompt field, the variable that is to contain the parameter value in the Variable field, and choose a control style and an assignment type.

Inserting a Prompt

To insert a prompt in the list:

  1. Select the prompt that appears immediately below where you want to insert the new prompt and click on the Add button to the left of the prompt list.
  2. Enter the text for the prompt in the Prompt field. Enter the variable that is to hold the parameter value in the Variable field.

Editing a Prompt

To edit an existing prompt:

  1. Select the prompt in the list. The prompt, variable name, control style, and assignment type appear in the fields below the list.
  2. Edit the appropriate value. When you click the mouse outside the field or press the Enter or Return key, Simulink updates the prompt.

Deleting a Prompt

To delete a prompt from the list:

  1. Select the prompt you want to delete.
  2. Click on the Delete button to the left of the prompt list.

Moving a Prompt

To move a prompt in the list:

  1. Select the prompt you want to move.
  2. To move the prompt up one position in the prompt list, click on the Up button to the left of the prompt list. To move the prompt down one position, click on the Down button.

 The Initialization Pane Control Types