[Top][All Lists]

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

Re: Reading text file data into matrices for selective plotting

From: Doug Stewart
Subject: Re: Reading text file data into matrices for selective plotting
Date: Wed, 8 Jun 2011 13:56:25 -0400

On Wed, Jun 8, 2011 at 1:25 PM, usagi713 <address@hidden> wrote:
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


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!


The data is stored in data

now it will be stored in   a

If you use the    whos   command you can see all the variables.

reply via email to

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