|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
Re: Help-octave Digest, Vol 42, Issue 28Am 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 _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
|
|
|
RE: Help-octave Digest, Vol 42, Issue 28If you do not want to copy the file by hand you can load also tell to use a path for example load -ascii "/path/to/datafile/data.dat" plot(data(1,:), data(2,:)) - mh |
|
|
Re: Help-octave Digest, Vol 42, Issue 28yes, 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 On Sun, Sep 13, 2009 at 5:24 PM, Martin Helm <martin@...> wrote: Am Sonntag, 13. September 2009 12:59:30 schrieb johny gaddar: _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
Re: Help-octave Digest, Vol 42, Issue 28Am 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 <martin@...> 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 _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
| Free embeddable forum powered by Nabble | Forum Help |