Using Simulink Previous page   Next Page

Using Model Arguments

Model arguments let you create references to the same model that behave differently. For example, suppose you want each reference to a counter model to be able to specify initial and increment values for the counter where the specified values can differ from reference to reference. Using model arguments to parameterize references to the counter model allows you to do this.

Using model arguments requires that you

The following sections explain how to perform these tasks.

Declaring Model Arguments

To declare some or all of a model's model workspace variables as model arguments:

  1. Open the referenced model.
  2. Open the Model Explorer.
  3. Select the model's workspace in the Model Explorer.

  4. If you have not already done so, use the Model Explorer to create MATLAB variables in the model's workspace that determine the model's behavior.

  5. Enter the names of the workspace variables that you want to declare as model arguments as a comma-separated list in the Model arguments field in the model workspace's dialog box.

  6. Click the Apply button on the dialog box to confirm the entered names.

Assigning Values to Model Arguments

If a model declares model arguments, you must assign values to the model arguments in each reference to the model, i.e., in each Model block that references the model.

To assign values to a model's model arguments in a Model block that references the model:

  1. Open the Model block's parameter dialog box.

  2. Enter a comma-delimited list of values for the parameter arguments in the Model argument values field in the same order in which the arguments appear in the Model arguments field.

  1. You can enter the values as literal values, variable names, MATLAB expressions, and Simulink parameter objects. The value for a particular argument must have the same dimensions and data and numeric type as the model workspace variable that defines the argument.


Previous page  Parameterizing Model References Model Block Sample Times Next page

© 1994-2005 The MathWorks, Inc.