How to xlswrite cell array with both strings and number?
1 view (last 30 days)
Show older comments
Supreet Hegde
on 30 Jul 2015
Commented: Supreet Hegde
on 31 Jul 2015
I have a cell array of the type A={'01:02:03'};
when I use the function: xlswrite('Output',A)
The excel sheet that I get has eliminated the first zero, it is reading the cell as a number and giving me output as '1:02:03'. How do I get the entire string without eliminating 0?
0 Comments
Accepted Answer
Azzi Abdelmalek
on 30 Jul 2015
Edited: Azzi Abdelmalek
on 30 Jul 2015
A={'''01:02:03'};
5 Comments
Azzi Abdelmalek
on 31 Jul 2015
s={'01:02:03';11; 20; '01:02:03';'01:02:03' ;11 ;10 }
idx=cellfun(@isstr,s)
s(idx)=strcat('''',s(idx))
xlswrite('fic.xlsx',s)
More Answers (1)
See Also
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!