nargin

nargin returns the number of input arguments passed into current function.

See also

nargout