In MATLAB®, varargin
and varargout
are
cell arrays. For code generation, to index varargin
and varargout
,
you must use a syntax that code generation supports. You can use the
most common syntax — curly braces {}
. For
example:
%#codegen function [x,y,z] = fcn(a,b,c) [x,y,z] = subfcn(a,b,c); function varargout = subfcn(varargin) for i = 1:length(varargin) varargout{i} = varargin{i}; end
You can use the following index expressions. The exp arguments must be constant expressions or depend on a loop index variable.
Expression | Description | |
---|---|---|
|
| Read the value of element exp |
| Read the values of elements exp1 through exp2 | |
| Read the values of all elements | |
|
| Read or write the value of element exp |
Note:
The use of |