help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Am I using varargin correctly?


From: WJ Atsma
Subject: Re: Am I using varargin correctly?
Date: Thu, 19 Jun 2003 11:11:42 +0200

Looks great. You can also use varargin{i} instead of nth(varargin,i).


On 2003.06.18 22:21 Jeff Sadowski wrote:
function ans=nfactor(varargin)

x=0;
ans=[];
while(x<nargin)
 if(size(ans)!=0 || nth(varargin(x+1),1) != 0)
  ans=[ans,nth(varargin(x+1),1)];
 endif
 x++;
endwhile;
ans=nfactor(ans);
endfunction




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]