Write the matrix M to the named file using delimiters.
file should be a file name or writable file ID given by fopen
.
The parameter delim specifies the delimiter to use to separate values on a row.
The value of r specifies the number of delimiter-only lines to add to the start of the file.
The value of c specifies the number of delimiters to prepend to each line of data.
If the argument "-append"
is given, append to the end of file.
In addition, the following keyword value pairs may appear at the end of the argument list:
"append"
Either "on"
or "off"
. See "-append"
above.
"delimiter"
See delim above.
"newline"
The character(s) to use to separate each row. Three special cases exist
for this option. "unix"
is changed into
"\n"
, "pc"
is changed into
"\r\n"
, and "mac"
is
changed into "\r"
. Any other value is used
directly as the newline separator.
"roffset"
See r above.
"coffset"
See c above.
"precision"
The precision to use when writing the file. It can either be a format string (as used by fprintf) or a number of significant digits.
dlmwrite ("file.csv", reshape (1:16, 4, 4));
dlmwrite ("file.tex", a, "delimiter", "&", "newline", "\n")
See also: dlmread, csvread, csvwrite.
Package: octave