|
Contents | Previous | Next | Subchapters |
| Syntax |
read(file, mtype, nr, nc)
|
| See Also | read(file, mtype) , read(file, mtype, nr) |
The first row of the resulting matrix corresponds to the first values read,
the next row to the next values read, and so on.
If there are not enough elements in a row of the file,
spaces are used to fill character matrices and zeros
are used to fill numeric matrices.
If there are more than enough elements in a row of the file,
the extra elements are ignored.
temp.dat that contains the text
(1,2) (3,4) (5,6)
(7,8) (9,10) (11,12)
by entering the following commands
clear
file = "temp.dat"
rmfile(file);
write(file, "(1,2) (3,4) (5,6)")
write(file, "(7,8) (9,10) (11,12)")
close(file)
If you then enter
read("temp.dat", "complex", 2, 2)
O-Matrix will respond
{
[ (1,2) , (3,4) ]
[ (7,8) , (9,10) ]
}