Reputation: 32081
I'm trying to use this function in octave:
[A,B,C,D,E] = textread(f, '%s %d %d %d %d', "headerlines", "1")
This version works fine:
[A,B,C,D,E] = textread(f, '%s %d %d %d %d')
The documentation is somewhat ambiguous on how exactly I should format options such as "headerlines".
The result I get when I try adding in the "headerlines" option:
octave:14> [A,B,C,D,E] = textread(f, '%s %d %d %d %d', "headerlines", 1)
error: textread: A(I): index out of bounds; value 1 out of bound 0
error: called from:
error: C:\MyProgramFiles\octave\Octave3.6.4_gcc4.6.2_20130408\Octave3.6.4_gcc4.6.2\share\octave\3.6.4\m\io\textread.m at line 75, column 3
Upvotes: 0
Views: 154
Reputation: 158
[a b c d e] = textread(f, '%s %d %d %d %d', 'headerlines', 1, "endofline", "\r\n")
(on Linux you probably want to use '\n' instead of "\r\n").Upvotes: 1