nargin

If called within the arguments of a function allows the last part or all of the argument list to have a variable number of inputs. When called with the input func, returns the number of required inputs.

Syntax

function ExampleFunc(nargin)

Example

Simple nargin example:

a=@sin;
b=@a;
nargin(b)
ans = 1