writetable() Error: Undefined function 'write' for input arguments of type 'double'

45 views (last 30 days)
Hello there!
I recently upgraded from a windows to a mac and am getting used to the system.
My xlswrite function that worked perfectly fine on my PC doesn't on a mac. The .csv file that I get when I run MATLAB2015a is missing 2 sheets of data. I tried replacing it with writetable but get the following error:
"Undefined function 'write' for input arguments of type 'double'."
I tried simplifying the process to backtrack any errors with magic(5) - Still get the same error.
Is there an alternative? One of the alternatives I found was to download javalibraries, I was hoping to get a simpler solution.
Please Help!!
Thanks!

Accepted Answer

Jan
Jan on 21 May 2015
writetable writes the table to a file, but not matrices of type double. So try to convert the matrix to a table at first.
Please post the code for writing the Excel file.
Notice the limitations of xlswrite:
If your computer does not have Excel for Windows®, or if the COM server
(part of the typical installation of Excel) is unavailable, then the xlswrite
function:
* Writes array A to a text file in comma-separated value (CSV) format. A must be a numeric matrix.
* Ignores the sheet and xlRange arguments.
A general hint: The documentation of Matlab is very useful. If you have problems with a specific command, reading the corresponding docs is a better help than in any other software I've used.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!