nargout
Number of function output arguments
描述
nargout
返回the number of function output arguments specified in the call to the currently executing function. Use this syntax in the body of a function only.
例子
输入参数
提示
当您将函数用作表达式的一部分时,例如
如果
声明,然后是matlab®用一个输出参数调用功能。因此,nargout
功能返回1
在表达式中。如果您检查一个
nargout
函数中的值为0,您指定输出的值,MATLAB填充ans
。但是,如果您检查nargout
并且不指定输出的值,然后MATLAB不修改ans
。