Declare Variable-Size Inputs and Outputs

  1. In the MATLAB Function Block Editor, select Edit Data.

  2. Select Add > Data

  3. Select the Variable size check box.

  4. Set Scope as either Input or Output.

  5. Enter size:

    For:What to Specify
    InputEnter -1 to inherit size from Simulink® or specify the explicit size and upper bound.

    For example, enter [2 4] to specify a 2-D matrix where the upper bounds are 2 for the first dimension and 4 for the second.

    OutputSpecify the explicit size and upper bound.

Was this topic helpful?