Main Content

Declare Variable-Size Outputs

By default, MATLAB Function block output variables are not variable-size. To make outputs variable-size:

  1. Double click the MATLAB Function block to open the MATLAB Function Block Editor.

  2. Open the Symbols pane and the Property Inspector. In the Function tab, click Edit Data.

  3. In the Symbols pane, select the output.

  4. In the Property Inspector, Properties tab, enable the Variable size property.

  5. In the Size property, specify the size as the upper bound. For example, to specify a 2-by-4 matrix as the largest acceptable size, enter [2 4].

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

See Also

Related Topics