Using Simulink Previous page   Next Page

Sizing 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 examine or specify the size of 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 a data row to select it.

You specify the size of an argument in the Model Explorer in the Size field of the Data properties pane on the right. You can also specify it in the Contents pane of the Model Explorer by clicking the cell in the Size column of the highlighted argument row and editing it.

The size of the arguments in the preceding example is -1. This is the default size for inputs and outputs. It specifies that the size of the argument is inherited from the Simulink signal that connects to it. Use the following topics to determine whether you want to keep the inherited size or size the arguments yourself.


Previous page  Specifying Argument Types with Expressions Inheriting Argument Sizes from Simulink Next page

© 1994-2005 The MathWorks, Inc.