Using Simulink Previous page   Next Page

Typing Function Arguments

In Programming the Embedded MATLAB Function, you create two output arguments and an input argument for an Embedded MATLAB Function block by entering them in its function header. This creates ports on the Embedded MATLAB Function block that you can attach to Simulink signals. You can select the type for each argument that you define for an Embedded MATLAB Function block. By default, they are assigned the type inherited. This means that type is assigned on the basis of the incoming or outgoing Simulink signal.

Examine the type for an argument in the Model Explorer as follows:

  1. From the Embedded MATLAB Editor, click the Explorer tool .
  1. The Model Explorer appears with the Embedded MATLAB Function block highlighted in the Model Hierarchy pane on the left.

  1. In the Contents pane, click on a data row to select it, as shown.

You specify the type of an argument in the Type field of the Data properties pane, as shown. You can also specify it in the Contents pane of the Model Explorer by clicking the cell in the Type column of the highlighted argument row and editing it.

The type of the arguments in the preceding example is inherited. This is the default type for all input and output data. Use the following topics to determine whether you want to keep the inherited type or specify the argument types yourself:


Previous page  Debugging Embedded MATLAB Functions Inheriting Argument Data Types Next page

© 1994-2005 The MathWorks, Inc.