help-octave
[Top][All Lists]
Advanced

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

Re: varargin with executable octave scripts


From: David Bateman
Subject: Re: varargin with executable octave scripts
Date: Wed, 13 Oct 2004 14:15:10 +0200
User-agent: Mutt/1.4.1i

According to address@hidden <address@hidden> (on 10/12/04):
> Thanks David. Both versions work. I am able to open a file mentioned on
> the command line by refering to it as vararg{1}, vararg{2} etc.
> Now, can you give also a pointer to your specific source of information,
> or it is not that simple ?
> Cheers, Avraham

If you are going to use argv{i} in a for-loop it is obvious that 
length(argv) is the number of times the for-loop needs to be called,
so there is no special source of knowledge there. For the __nargin__
I'm aware that in 2.1.58, __nargin__ appears as a local variable
(but probably shouldn't), as whos will show... In fact on 2.1.60
I just tried this

% octave -q
octave:1> nargin
ans = 1
octave:2> __nargin__
__nargin__ = 1
octave:3> argv{1}
ans = -q

so it is quite frankly puzzling that your original example didn't 
work. I'd suggest using length(argv) as something that is logical
to do, rather than relying on nargin in this case.

Regards
David

-- 
David Bateman                                address@hidden
Motorola CRM                                 +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 1 69 35 77 01 (Fax) 
91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



-------------------------------------------------------------
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]