From help-octave-request at bevo dot che dot wisc dot edu Sun Jul 20 20:28:11 2003 Subject: loading a filename beginning with a digit From: Mike Miller To: Help-Octave List Date: Sun, 20 Jul 2003 20:25:55 -0500 (CDT) Suppose, for example, that I have a file named 2x.txt with these contents: 1 3 9 5 (Just two lines with two integers per line, but in real life I'll want to do this with larger files!) When I load the file, I am not able to access the data. (Please don't tell me to rename the file! I just want to make the load function work within a script I'm writing no matter what the filename, if that's possible.) I did this in a couple of versions of Octave on Solaris 8: octave:1> load 2x.txt octave:2> whos *** local user variables: prot type rows cols name ==== ==== ==== ==== ==== wd matrix 2 2 2x octave:3> 2x parse error: >>> 2x ^ octave:3> "2x" ans = 2x octave:4> eval("2x") parse error: >>> 2x ^ error: evaluating index expression near line 4, column 1 So, Octave seems to load the 2x2 matrix, but I just can't figure out how to get at it. (I thought Octave didn't allow variables beginning with a digit.) I'd really like to be able to rename the loaded matrix, but how? Thanks in advance for any tips! Mike -- Michael B. Miller, Ph.D. Assistant Professor Division of Epidemiology and Institute of Human Genetics University of Minnesota http://taxa.epi.umn.edu/~mbmiller/ ------------------------------------------------------------- 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 -------------------------------------------------------------