Contents Previous Next Subchapters

Number of Return Values Corresponding to a Function Call
Syntax nargout
See Also nargin , arg(0)

Description
Returns the number of return values in a function call. If you enter
     clear
     function [x, y] = f(a, b) begin
          x = nargout
     end
     [u, v] = f(5)
     print u
O-Matrix will respond
     2
because there are two return values in the call to the function f. If you continue by entering
     f(5)
O-Matrix will respond
     1
because there is only one return value corresponding to the call to f.