help-octave
[Top][All Lists]
Advanced

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

gnuplot like I/O


From: John W. Eaton
Subject: gnuplot like I/O
Date: Mon, 29 Jan 2001 08:43:25 -0600

On 29-Jan-2001, Osvaldo Clua <address@hidden> wrote:

| Hello:
|       Is there any way of doing I/O into/from files in gnuplots 
| format (i.e, one column per variable, "#"s as comments, ascii) other than
| "programming" it with "c" style and loops?
|       Any workaround appreciated

How about putting your variables in a matrix and using load and save
with Octave's ASCII format?

  v1 = rand (5, 1);
  v2 = rand (5, 1);
  tmp = [v1, v2];
  save -ascii file tmp

should produce a file with contents that look something like this:

  # Created by Octave 2.1.33, Mon Jan 29 08:42:35 2001 CST <address@hidden>
  # name: tmp
  # type: matrix
  # rows: 5
  # columns: 2
   0.264249056577682 0.255416959524155
   0.673603057861328 0.53104555606842
   0.600114524364471 0.27253258228302
   0.576247334480286 0.87994658946991
   0.810935854911804 0.336248934268951

Octave's load command should have no trouble reading that file.

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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