C Math Library Reference | ![]() |
Build a list of varargout
output arguments from array variables.
Minimum number of input arguments: one, maximum: user-defined. Terminate the argument list with a NULL
.
C Prototype
mlfVarargoutList *mlfVarargout(mxArray **ppa, ...);
Arguments
mxArray **ppa
A pointer to a pointer to an array.
Return
A cell array containing the output arguments.
Description
When the variable varargout
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.
In the MATLAB C Math Library, you use mlfVarargout()
to construct the output argument list for varargout
routines. The routine puts the arguments in a cell array. You must terminate the list with a NULL
.
Constructs a varargout list from non-indexed arrays.
Initialize function inputs and outputs to NULL.
Varargout functions can return just 1 output value, returned as the result from the varargout function.
Example
This example uses the mlfDeal()
routine to illustrate constructing a varargout
list. The example creates a vector with the values [ 1 2 3 4 5 6 7 8 9 10 ]
and copies this vector to each of the output arrays, A
and B
.
mxArray *A = NULL; mxArray *B = NULL; mlfDeal(mlfVarargout(&A,&B,NULL),mlfColon(mlfScalar(1), mlfScalar(10),NULL));
See Also
![]() | mlfSetPrintHandler |