# nargin

Returns the number of input arguments.

## Syntax

* R = nargin()
* R = nargin(function\_name)
* R = nargin(function\_handle)

## Input argument

* function\_name - a string: function name
* function\_handle - a function handle

## Output argument

* 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:

```matlab
nargin('getfield')
```

With an builtin function:

```matlab
nargin('cos')
```

## See also

[nargout](nargout).

## History

| Version | Description     |
| ------- | --------------- |
| 1.0.0   | initial version |

## Author

Allan CORNET
