Home >Common Problem >What does nargin mean in matlab?
nargin is the abbreviation of "number of input arguments". When defining a function in MATLAB, inside the function body, nargin is a function used to determine the number of input variables.
Enter help nargin or doc nargin in the matlab command window to get help information for this function. (Recommended learning: PHP video tutorial)
Function
nargin is a function used to determine the number of input variables, especially when using In functions with variable parameter lists, it is convenient to use nargin to obtain the number of input parameters.
Calling format
nargin nargin(fx)
Function description
nargin returns the input parameters by calling the currently executing function Quantity, only use the nargin syntax feature within the function body.
nargin(fx) returns the number of input parameters in the definition statement of function fx. If the function includes varargin in its definition, then the number of inputs returned by nargin is negative.
For example, the function foo input has three parameters a, b, and varargin, then the return value of nargin('foo") is -3.
For more PHP related technical articles, please visit PHP Graphic Tutorial column to learn!
The above is the detailed content of What does nargin mean in matlab?. For more information, please follow other related articles on the PHP Chinese website!