FUNCTION REFERENCE

writematrix

Write a numeric matrix to a text file.

Write a numeric matrix to a text file.

Syntax

writematrix(A, 'out.csv')

Syntax

writematrix(A, 'out.csv', 'Delimiter', ';')

Delimiter is comma (default), semicolon, tab or space (also named 'space' or 'whitespace'). Use a .csv, .txt or .dat name, or add 'FileType', 'text'. Call it as a statement.

Example

writematrix([1 2; 3 4], 'out.csv')   % writes two lines: 1,2 and 3,4

Differences from MATLAB: Statement only; no output assignment. Overwrites the file; no append. Writing spreadsheets (.xlsx, .xls) is not supported yet and gives an error.

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