help-octave
[Top][All Lists]
Advanced

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

plot a line, error: invalid row index


From: gauthier
Subject: plot a line, error: invalid row index
Date: Tue, 25 Nov 2008 05:40:33 -0800 (PST)

Hi!

I'm running Octave 3.0.3 on windows (not cygwin, the windows build).

I'm having troubles with the line function. It seems to be disturbed by the
file functions.
Exactly after I started Octave, the following works:

> x=1:1:100;
> plot (x, sin(x));
> line([70 70], [-1 1]);


But after I've run for some time, I get the following error:
> line([70 70], [-1 1]);
error: invalid row index = 70
error: invalid column index = -1



After removing parts of the script I use bit for bit I arrived to the
following conclusion:
"line" does not work after I've use this bit of code:

---
filename = "c:\\Temp\\infifo1.txt";
fid = fopen (filename);
line = fgetl(fid);
line = fgetl(fid);
% fscanf can't seem to recognise windows-style end of line!
inputMat = fscanf(fid, "%*6c %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d
%d\n");
fclose (fid);
---



This my octave prompt after the test:

octave-3.0.3.exe:1> x=1:1:100;
octave-3.0.3.exe:2> plot (x, sin(x));
octave-3.0.3.exe:3> line([70 70], [-1 1]);
octave-3.0.3.exe:4> filename = "c:\\Temp\\infifo1.txt";
octave-3.0.3.exe:5> fid = fopen (filename);
octave-3.0.3.exe:6> line = fgetl(fid);
octave-3.0.3.exe:7> line = fgetl(fid);
octave-3.0.3.exe:8> inputMat = fscanf(fid, "%*6c %d %d %d %d %d %d %d %d %d
%d %d %d %d %d %d %d\n");
octave-3.0.3.exe:9> fclose (fid);
octave-3.0.3.exe:10> x=1:1:100;
octave-3.0.3.exe:11> plot (x, sin(x));
octave-3.0.3.exe:12> line([70 70], [-1 1]);
error: invalid row index = 70
error: invalid column index = -1
octave-3.0.3.exe:12> 


Attached is an example of the possible content of the file infifo1.txt, if
you want to try the commands above.
http://www.nabble.com/file/p20681391/infifo1.txt infifo1.txt 



Does anyone know what is going on?

Thanks in advance!
-- 
View this message in context: 
http://www.nabble.com/plot-a-line%2C-error%3A-invalid-row-index-tp20681391p20681391.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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