| MATLAB C Math Library | Search  Help Desk |
| mlfIndexVarargout | Examples See Also |
Build a list of output arguments, some of which are indexed expressions
C Prototype
mlfVarargoutList *mlfIndexVarargout(mxArray **ppa, ...);
Arguments
mxArray **ppaReturn
A cell array containing the output arguments.Description
When the variablevarargout appears as the last output argument in the definition of a MATLAB function, that function can return any number of outputs, starting at that position in the argument list.
If you are indexing into any of the arrays that you pass as varargout output arguments, you must use mlfIndexVarargout() to form the varargout list. For indexed arguments, you specify the a pointer to the source array pointer, the index format string, and the index values, just as you would with the mlfIndexRef() routine. For nonindexed arguments, you specify the array argument paired with a NULL argument.
Example
In this example, output argumentsz and n are indexed expressions. Note the similarity to mlfIndexRef() syntax. Because argument m is nonindexed, you follow it with a NULL argument to indicate that there is no associated indexing syntax with this argument.
mxArray *x = NULL, *y = NULL, *z = NULL, *m = NULL, *n = NULL;
mlfAssign(&x, mlfVarargout_Function(&y,
mlfIndexVarargout(&z, "(?)", mlfScalar(1),
&m, NULL,
&n, "{?}", mlfCreateColonIndex(),
NULL),
a, b)));
See Also
mlfVarargout, mlfIndexRef, mlfIndexAssign