help-octave
[Top][All Lists]
Advanced

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

Reading text file data into matrices for selective plotting


From: usagi713
Subject: Reading text file data into matrices for selective plotting
Date: Wed, 8 Jun 2011 10:25:08 -0700 (PDT)

I am a beginner to Octave and thus a little unfamiliar with some of the
commands; so, I apologize in advance.

I have a .txt file with only numerical data (tab-separated) in four columns.
Here are a few lines from the file:
389.28461       500     5.00E-03        1.00E-03
284.69223       500     1.60E-02        1.00E-03
390.87271       50      5.00E-04        1.00E-03
390.89734       5       5.00E-04        1.00E-03
390.89981       0.5     5.00E-04        1.00E-03
390.90009       5.00E-03        5.00E-04        1.00E-03

I want to write a script that will go through the file, read the values into
a matrix, and then make 3-D plots for certain constant values in some of the
columns. (To better explain that last part, let's say I wanted to keep the
third column values constant. So, the first column would be my Z-values, the
second column would be the X-values, and the fourth column would be the
Y-values for graphs having the same value in the third column. Based on the
example lines from the file, the last four lines would be graphed on the
same graph, while the first two lines would be graphed on other graphs
because they have different values in the third column.)

I am thinking that the first part should be relatively simple. I used the
command

load("C:\\Octave\\Test\\data.txt")

which seemed to work, but I don't know where the data is being stored, i.e.,
what is the name of the matrix in which the data is being stored?

Once I know that, I suppose there is probably some way to write a script
that will go through the matrix and only graphing the rows with a certain
value in one of the columns.

If you could offer some insight on what I am trying to do, it would be very
much appreciated. Thank you!

--
View this message in context: 
http://octave.1599824.n4.nabble.com/Reading-text-file-data-into-matrices-for-selective-plotting-tp3583138p3583138.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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