From help-request at octave dot org Tue Oct 12 11:01:05 2004 Subject: Re: varargin with executable octave scripts From: David Bateman To: mavram at bezeqint dot net Cc: help-octave at octave dot org Date: Tue, 12 Oct 2004 17:51:54 +0200 Try it as with length(argv) or __nargin__. That is #! /usr/bin/octave -qf printf ("%s", program_name); for i = 1:length(argv) printf (" %s", argv{i}); endfor printf ("\n"); size(argv) or #! /usr/bin/octave -qf printf ("%s", program_name); for i = 1:__nargin__ printf (" %s", argv{i}); endfor printf ("\n"); size(argv) Seems the docuemntation is wrong. wrong.. D. According to mavram at bezeqint dot net (on 10/12/04): > Sorry for the dumb question: > Example from info, very slightly modified, named autonome: > > #! /usr/bin/octave -qf > printf ("%s", program_name); > for i = 1:nargin > printf (" %s", argv{i}); > endfor > printf ("\n"); > size(argv) > nargin > who > > autonome addhour cleancat gracespectra > autonome > ans = > > 3 1 > > ans = 0 > > *** dynamically linked functions: > > dispatch > > *** local user variables: > > i > > Not the output I expected. Either I made some blunder(s) or the info is badly > out of tune with my version of octave (2.1.57). > Any suggestions ? I would like this script to input data from a file, to > be specified on the command-line. > System: Debian Linux testing/unstable, kernel 2.4. > Thanks for any advice/pointer, > Avraham > > > > ------------------------------------------------------------- > 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 > ------------------------------------------------------------- -- David Bateman David dot Bateman at motorola dot com 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 -------------------------------------------------------------