help-octave
[Top][All Lists]
Advanced

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

Re: Help-octave Digest, Vol 42, Issue 28


From: Martin Helm
Subject: Re: Help-octave Digest, Vol 42, Issue 28
Date: Sun, 13 Sep 2009 17:38:56 +0200
User-agent: KMail/1.10.3 (Linux/2.6.27.29-0.1-default; KDE/4.1.3; x86_64; ; )

Am Sonntag, 13. September 2009 17:13:47 schrieb johny gaddar:
> yes, i am storing the output of the program in .dat kind of file
>
> the file contents look like this.....
>
>
> 0 1
> 1 3
> 4 7
> 7 8
>
> and so on.
> there are only two columns. of integers. thats all.
> i want to plot second column against first column in octave.
> other than this, file does not contain anything else.
>
> regards,
> Johny
>

So the form

load -ascii "/path/to/datafile/data.dat" 
plot(data(1,:), data(2,:)) 

should work (assuming data.dat) otherwise the resulting variable has simply a 
different name

mymatrix.dat -> mymatrix cointains the data and so on. 


> On Sun, Sep 13, 2009 at 5:24 PM, Martin Helm <address@hidden> wrote:
> > Am Sonntag, 13. September 2009 12:59:30 schrieb johny gaddar:
> > > Hello
> > >
> > > i am new user to octave
> > >
> > > i have a c program whose output which is two colums of data should be
> > > plotted by octave as X and Y
> > > i am using red hat machine.
> > >
> > > any suggestions are appreciated.
> > >
> > > regards
> > > Johny
> >
> > Dear Johny,
> >
> > from your description I asume that your program creates some file which
> > you want to read in octave to plot it (is that correct).
> > Can you provide a simple example of such file to see the format of the
> > numbers
> > how they are delimited and if the file contains some header?
> > Then I can give you a hint how to read and display it.
> >
> > In general you can for example look at csvread and similar functions
> >
> > help csvread
> > `csvread' is a function from the file
> > /usr/share/octave/3.2.0/m/io/csvread.m
> >
> >  -- Function File: X = csvread (FILENAME)
> >     Read the matrix X from a file.
> >
> >     This function is equivalent to
> >          dlmread (FILENAME, "," , ...)
> >
> >     See also: dlmread, dlmwrite, csvwrite
> >
> > - mh



reply via email to

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