How do I save a cell array that contains both strings and numbers to an excel in string format only?

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

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.

Sign in to comment.

Answers (0)

Tags

Asked:

on 7 Nov 2016

Commented:

on 7 Nov 2016

Community Treasure Hunt

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

Start Hunting!