Main Content

Declare Variable-Size Inputs and Outputs

By default, a MATLAB Function block input signal or output signal is not variable-size. To make the signal variable-size:

  1. In the MATLAB Function Block Editor, select Ports & Data Manager.

  2. Select the input or output signal.

  3. Select the Variable size check box.

  4. Enter the size according to this table.


    To inherit the size from Simulink®, enter -1.

    Otherwise, specify the explicit size and upper bound. For example, to specify a 2-by-4 matrix, enter [2 4].

    OutputSpecify the explicit size and upper bound.

If the data is not an input or an output, define the variable-size data using the coder.varsize function.

See Also

Related Topics