From help-octave-request at bevo dot che dot wisc dot edu Tue Jan 19 09:27:40 1999 Subject: how to read matrices ? From: "John W. Eaton" To: Jochen Solbrig Cc: help-octave at bevo dot che dot wisc dot edu (octave-ml) Date: Tue, 19 Jan 1999 09:27:39 -0600 (CST) On 19-Jan-1999, Jochen Solbrig wrote: | i' trying to read matrices like this one from a data file: | 1 2 | 2 6 | 3 9 | | i could use the function "load" but this case i have to | specify the name of the matrix and it's number of | columns and rows in a header. Are the matrices that you want to read all in separate data files? If so, you can use load without having to add the header info. The variable name will be constructed from the file name. For example, $ cat > foo.dat 1 2 2 6 3 9 $ octave Octave, version 2.0.13 (i686-pc-linux-gnulibc1). Copyright (C) 1996, 1997, 1998 John W. Eaton. This is free software with ABSOLUTELY NO WARRANTY. For details, type `warranty'. octave:1> load foo.dat octave:2> who *** local user variables: foo octave:3> foo foo = 1 2 2 6 3 9 jwe