Main Content

Code Generation for Variable Length Argument Lists

When you use varargin and varargout for code generation, there are these restrictions:

  • You cannot use varargin or varargout in the function definition for a top-level function in a MATLAB Function block or in a Stateflow® chart that uses MATLAB® as the action language.

  • You cannot write to varargin. If you want to write to input arguments, copy the values into a local variable.

  • To index into varargin and varargout, use curly braces {}, not parentheses ().

  • The code generator must be able to determine the value of the index into varargin or varargout.

Related Topics