help-octave
[Top][All Lists]
Advanced

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

request for help with textread


From: Kristoffer Walker
Subject: request for help with textread
Date: Fri, 06 Sep 2013 16:02:51 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8

Hello,

I have recently installed octave 3.6.1 on Linux Mint v. 13 (version of Ubuntu 12). Data file "test.in":

1336 901
0.000000 0.000000 0.3329580775 -0.0022473728 -0.0008216525
0.000000 0.200000 0.3320154915 -0.0023726505 -0.0009491121

[x10,y10]=textread("test.in","%f %f%*[\n]","headerlines",1);
error: textread: A(I): index out of bounds; value 1 out of bound 0
error: called from:
error:   /usr/share/octave/3.6.1/m/io/textread.m at line 75, column 3

If I explicitly add the number of lines to read:

[x10,y10]=textread("test.in","%f %f%*[\n]",2,"headerlines",1);
error: strread: A(I): index out of bounds; value 1 out of bound 0
error: called from:
error:   /usr/share/octave/3.6.1/m/io/strread.m at line 287, column 7
error:   /usr/share/octave/3.6.1/m/io/textread.m at line 128, column 34

If I remove the part about skipping the latter half of each line:

[x10,y10]=textread("test.in","%f %f","headerlines",1);
error: textread: A(I): index out of bounds; value 1 out of bound 0
error: called from:
error:   /usr/share/octave/3.6.1/m/io/textread.m at line 75, column 3

If I ignore all intelligent arguments:

[x10,y10]=textread("test.in","%f %f");

works fine, but then x10,y10 contain values from other columns not of interest.

Can someone tell me what I am doing wrong?  I read the help page completely.

Version: `textread' is a function from the file /usr/share/octave/3.6.1/m/io/textread.m

Thank you,
Kris Walker


--
Kristoffer T. Walker
Assoc. Research Geophysicist
Scripps Institution of Oceanography
La Jolla, CA 92093-0225
http://sail.ucsd.edu/~walker
+1-858-534-0126 (work)



reply via email to

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