csvWriteWrite comma-separated value fileCalling Sequence
csvWrite(M, filename)
csvWrite(M, filename, separator)
csvWrite(M, filename, separator, decimal)
csvWrite(M, filename, separator, decimal, precision)
csvWrite(M, filename, separator, decimal, precision, comments)
Argumentsfilenamea 1-by-1 matrix of strings, the file path.Ma m-by-n matrix of strings or double (complex
supported).
separatora 1-by-1 matrix of strings, the column separator mark.decimala 1-by-1 matrix of strings, the decimal mark. The available
values are "." or ",".
precisiona 1-by-1 matrix of strings, the C format.commentsa m-by-1 matrix of strings, the comments stored at the
beginning of the file. This option may be used, for example, to put
a licence header in a data file.
DescriptionThis function writes matrix M into filename as comma-separated
values.
The default value of the optional input arguments are defined by the
csvDefault function.
Any optional input argument equal to the empty matrix
[] is set to its default value.
If the file filename already exists, it is
overwritten.
If relevant (ie with 'special' characters), the file will be saved as UTF-8.
ExamplesIn the following example, we combine the
csvWrite and csvRead
functions.
In the following example, we use various options of the
csvWrite function.
The following examples are more advanced uses of the
csvWrite function.
See Also
csvRead
History5.4.0Function introduced. Based on the 'csv_readwrite' module.