FUNCTION REFERENCE

dlmwrite

Write a matrix to a delimited file.

Write a matrix to a delimited file.

Syntax

dlmwrite(filename, M)

Syntax

dlmwrite(filename, M, delimiter, r, c)

Syntax

dlmwrite(filename, M, '-append', 'precision', p, 'newline', nl)

The default delimiter is a comma and the default precision is %.5g. precision is

a number of significant digits or a format such as '%8.3f'. r and c add empty

rows and columns in front. newline is 'pc' or 'unix'. The file is only

written once all arguments are checked, so a rejected call leaves it unchanged.

Example

dlmwrite('m.txt', [1 2.5; 3 pi])   % file has "1,2.5" and "3,3.1416"

Differences from MATLAB: the real part of complex data is written; output over

8 MiB is refused; an invalid precision format such as '%z' is an error, where

MATLAB writes an empty line.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.