WRITE command
| Syntax: |
WRITE file x1 { x2 ... }
|
| Qualifiers: |
\SCALAR, \MATRIX, \TEXT, \APPEND
|
| Examples: |
WRITE FILE.DAT X Y Z
|
The WRITE command is a general purpose writing
command for vectors, scalars, matrices, or character strings. The variable type that will
be written depends on the qualifier appended to the command. The parameters that are
expected also depend on this qualifier.
Write vectors
By default, the WRITE command writes vectors to a
file. If the \APPEND qualifier is used, and if the
output file already exists, the data will be appended onto the end of the file. Columns of
data will be written to the file, where the Ith column will be
vector xI. The number of lines that are written to the file will
be the minimum length of the vectors. A maximum of 29 vectors can be written
with one WRITE command.
Example 1
If you have a vector, for example, X, and enter
WRITE FILE.DAT X X X
then the following values will be written to the file:
X(1) X(2) X(3) X(4) X(5) X(6) ...
Example 2
To write the vectors X, Y and Z to the file
DUM.DAT so that there will be three columns of numbers in the file, enter:
WRITE DUM.DAT X Y Z
If you enter:
WRITE DUM.DAT X X Y Y Z Z
then the following will be written to the file:
X(1) X(2) Y(1) Y(2) Z(1) Z(2)
X(3) X(4) Y(3) Y(4) Z(3) Z(4)
X(5) X(6) Y(5) Y(6) Z(5) Z(6)
... ... ... ... ... ...