How do I save a cell array that contains both strings and numbers to an excel in string format only?
Show older comments
Hi,
when trying to save a cell array as {'day','0000';'night','3'} using xlswrite, the cell '0000' is identified as number ans not as string, therefore, turns into '0'.
How can I save all the cells as strings? (I tried to use num2str on each cell before exporting and it did not help)
Tx!
1 Comment
Walter Roberson
on 7 Nov 2016
I confirm this behaviour with R2016b on Windows 10 with Excel 2016. When I check the xlsx that is generated in detail, I can see that the '0000' and '3' are stored as numeric, not as string, so it is not an issue with the text really being stored but being displayed oddly.
Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!