wrting a cell array of strings to excel
1 回表示 (過去 30 日間)
古いコメントを表示
This is more of an Excel question than Matlab.
H1 H2 H3 H4 H5 20080 34611 ABC 123 10,21,30 20080 34612 DEF 567 1,2,5
I have a cell array called output displayed above which I write to excell from matlab via
xlswrite('opfile.xlsx', output, 'outsheetname', 'A1')
But Excel interprets the last column (an array of strings) incorrectly as it has both commas and integers and the resulting column is incorrectly displayed - even when the Excel cells are formatted as text. (The other columns are displayed correctly)
When I write the last column of output to a text file via
temp = [ output(:,5)'] ifp = fopen('outfile.txt', 'w') fprintf(ifp, '%s\n', temp{:}) fclose(ifp)
the text is written perfectly.
any ideas? Thanks
0 件のコメント
回答 (1 件)
Robert Cumming
2011 年 4 月 11 日
You could also investigate
dlmwrite
where you can specify the delimiter for importing into excel.
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!