www.delorie.com/gnu/docs/octave/Octave-FAQ_12.html   search  
 
Buy GNU books!


Frequently asked questions about Octave (with answers)

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.8 Variable-length return lists

Octave also has a real mechanism for handling functions that return an unspecified number of values, so it is no longer necessary to place an upper bound on the number of outputs that a function can produce.

Here is an example of a function that uses the new syntax to produce `N' values:

 
function [...] = foo (n)
  for i = 1:n
    vr_val (i);
  endfor
endfunction


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003