Skip to content

xlswrite

Write data to an Excel (.xlsx) file.

xlswrite(filename, A)
xlswrite(filename, A, sheet)
xlswrite(filename, A, sheet, range)
[status, message] = xlswrite(filename, A, ...)

Writes A (a matrix or cell array) to an Excel workbook. With sheet, writes to the named sheet (created if missing). With range, writes starting at the upper-left cell of the range. Two-output form returns status (logical success) and message (error or warning text).

xlswrite('out.xlsx', magic(5), 'Results', 'A1')
  • xlsread — Read data from an Excel (.xlsx) file.
  • csvwrite — Write a matrix to a CSV file.