nargout
Returns the number of output arguments.
📝Syntax
R = nargout()
R = nargout(function_name)
R = nargout(function_handle)
📥Input Arguments
Parameter Description
function_name a string: function name
function_handle a function handle
📤Output Arguments
Parameter Description
R an integer value: number of output argument
📄Description

nargout returns the number of output arguments of an function.

If the last output argument of the function is varargout the returned value is negative.

💡Examples
With an macro function:
nargout('cellstr')
With an builtin function:
nargout('cos')
🔗See Also
nargin
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub