How to write a cell array of numbers and string to file

 Accepted Answer

xlswrite('test.xls',{'abc',1;2,'adsjk'});

3 Comments

Sounds good, provided no string is more than 191 characters and the number of rows and columns do not exceed the limits of Excel. Note also this will only work on MS Windows and only if Excel is installed (it will not work on Mac even if Excel is installed there.)
A point to note for future reference: xlswrite() cannot write if there are nested cell arrays. And don't even _think_ about writing objects.
Probably a typo. The limit on the number of characters allowed in a cell when using xlswrite() is 911, not 191.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!