help-octave
[Top][All Lists]
Advanced

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

newbie argv questions


From: swest
Subject: newbie argv questions
Date: Fri, 22 Dec 2000 21:35:27 -0000
User-agent: eGroups-EW/0.82

I am completely new to Octave.  I'm switching from many years of
MathCad.

I'm writing a stand-alone script that passes 2 files on the command
line, but am having some problems with argv.  I've checked the Octave
docs on the website, but cannot find a discussion that answers my
questions.

It appears that I cannot simply open the files with:

load (argv(i,:)), etc  since the length of each string in argv is set
to the maximum length of the longest string in the parameter list. 
This causes the appending of extra spaces on the end of arguments that
are shorter--which seems to deny file name matches in glob.

So I am now using:

load (sscanf (argv(i,:), '%s', Inf))  which properly gets just the
non-space string portion of the argument.  Do I really have to do
this?

Now load seems to assign a name to the data array in the file that is
the file name itself.

However, typing  argv(1,:) <CR>

doesn't print the array elements that were in the file, but just the
array name.  How do I print the array elements?

Thanks much--just having some culture shock from MathCad to Octave...

swest





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