How to xlswrite cell array with both strings and number?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Azzi Abdelmalek
2015-7-30
编辑:Azzi Abdelmalek
2015-7-30
A={'''01:02:03'};
5 个评论
Azzi Abdelmalek
2015-7-31
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)
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!