Within a function, return the number of values the caller expects to receive. If called with the optional argument fcn_name, return the maximum number of values the named function can produce, or -1 if the function can produce a variable number of values.
For example,
f ()will cause
nargout
to return 0 inside the functionf
and[s, t] = f ()will cause
nargout
to return 2 inside the functionf
.At the top level,
nargout
is undefined.