I use xlswrite (and csvwrite), but my time format is changing to "43:04.6" from 2016/3/03 00:43:4.567. How can get the same time format as it is displaying in input.
How write to CSV(of column matrix
4 次查看(过去 30 天)
显示 更早的评论
Hi,
I Have a four column matrix.I used cell2csv to write to csv file. By using cell2csv it wrote to only four column with space.
My matrix is:
column1 column2 Date rank
Name1 name2 2016/3/03 00:43:4.567 12
But when it wrote to CSV:
Name1 name2 2016/3/03 00:43:4.567 12
all in single column with space between each content of four columns. How to write to column matrix.
Many thanks in advance,
3 个评论
Walter Roberson
2016-3-5
Is your 2016/3/03 00:43:4.567 a datetime object or is it a string?
Have you considered using tables and writetable() ? http://www.mathworks.com/help/matlab/ref/writetable.html
writetable() itself requires R2013b or later, but datetime objects require R2014b or later.
回答(1 个)
Walter Roberson
2016-3-5
cell2csv is not part of MATLAB. There is a File Exchange Contribution http://www.mathworks.com/matlabcentral/fileexchange/7601-cell2csv/content/cell2csv.m . Unfortunately that code is clearly broken -- it uses eval to construct values, so it is going to get some values wrong.
Consider using http://www.mathworks.com/matlabcentral/fileexchange/25387-write-cell-array-to-text-file . Or just write your own code.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!