Code Generation for Variable Length Argument Lists
When you use varargin
and varargout
for
code generation, there are these restrictions:
If you use
varargin
to define an argument to an entry-point function, the code generator produces the function with a fixed number of arguments. This fixed number of arguments is based on the number of arguments that you specify when you generate code.You cannot write to
varargin
. If you want to write to input arguments, copy the values into a local variable.To index into
varargin
andvarargout
, use curly braces{}
, not parentheses()
.The code generator must be able to determine the value of the index into
varargin
orvarargout
.