[Top][All Lists]

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

Re: Easy reading of a data file

From: John Eaton
Subject: Re: Easy reading of a data file
Date: Mon, 14 Feb 94 18:58:58 CST

address@hidden (Pettiaux Nicolas) wrote:

:       We are starting to use Octave. Is there an easy way to 
: read column data files in octave or does it have to be done
: with the other C-style input/output functions ?
: ie.
: AI want to read in a file containing
: a aa
: b bb
: c cc
: ...

You can do it with C-style I/O functions, but it is probably much
faster to do it with the load command.  To do this, you will need to
add some comments to the beginning of the file that tell Octave how
much data to expect, and the variable name to store it in.  The load
command expects data in the same format as created by the save
command.  You can do something like

  a = [1,2;3,4]
  save - a

to get an example of the format used by the save command.  (Using `-'
as the file name tells save to print to the screen instead of saving
the data in a file.)


reply via email to

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