help-octave
[Top][All Lists]
Advanced

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

Plotting from txt file


From: skematic
Subject: Plotting from txt file
Date: Sat, 26 Nov 2016 15:51:52 -0800 (PST)

Dear all,

I have a text file that looks like this

2723 PID 20.00 21.56 0.00 0.00 0.00 0.00 Manual Direct
3723 PID 20.00 21.56 0.00 0.00 0.00 0.00 Manual Direct
4724 PID 20.00 21.56 0.00 0.00 0.00 0.00 Manual Direct
5725 PID 20.00 21.56 0.00 0.00 0.00 0.00 Manual Direct
6725 PID 20.00 21.56 0.00 0.00 0.00 0.00 Manual Direct
7727 PID 20.00 21.56 0.00 0.00 0.00 0.00 Manual Direct

I want to make a 2D plot with column 1 as x and column 4 as y.

I've looked up online, here is what I end up with.

filename='output1480196986778.txt';
fid = fopen(filename, 'r');
data = textscan(fid, '%s %s %s %s %s %s %s %s %s %s');
plot(data{1}, data{4});
fclose(fid);

data does get populated with the data from the txtfile but the plot function
gives this 

error: plot: no data to plot
error: parse error

How can I make this plot?




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Plotting-from-txt-file-tp4680792.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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