| Using Simulink | ![]() |
Specifying Argument Types with Expressions
You can specify the type of an argument with an expression that you enter in the Type field of its Data properties dialog box as follows:
type operator that returns the type of a previously defined variable.
x is already defined, enter type(x). In this case, x can be another argument. x can be defined with any supported type, including the type inherited.
In the following example, the local variable data is specified with a DataType of type(vals). The input data vals inherits its type from a Constant block whose output signal is set to the type uint8.
Click the Build tool
to compile and build the model from the Embedded MATLAB Editor. When the model is compiled, the actual type of data appears in the CompiledType column in the Contents pane.
| Selecting Types for Arguments | Sizing Function Arguments | ![]() |
© 1994-2005 The MathWorks, Inc.