nargin
Returns the number of input arguments.
📝Syntax
R = nargin()
R = nargin(function_name)
R = nargin(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 input argument
📄Description

nargin returns the number of input arguments of an function.

If the last input argument of the function is varargin the returned value is negative.

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