How do I properly use xlswrite?
3 ビュー (過去 30 日間)
古いコメントを表示
Matthew Covington
2019 年 4 月 14 日
コメント済み: Matthew Covington
2019 年 4 月 15 日
I have the code below in my function, however it doesn't write the data as I expected. instead of writing '2018-19 Auburn Women Basketball Home game as of 03/23/2019' all in cell A1 it puts each character in a different cell. This is happening with all of my string data.
lastGameDate = [stats(sRows, 1), stats(sRows, 2), stats(sRows, 3)];
xlsTitle = sprintf('2018-19 Auburn Women Basketball Home games as of %02.0f/%02.0f/%d',...
lastGameDate);
xlswrite(FILENAME, xlsTitle, OUTSPREADSHEET, 'A1')
0 件のコメント
採用された回答
Walter Roberson
2019 年 4 月 14 日
Try
xlswrite(FILENAME, {xlsTitle}, OUTSPREADSHEET, 'A1')
However if you are not using MS Windows or if you do not have Excel installed on MS Windows, then xlswrite cannot handle the task for you: without Excel on Windows, xlswrite is restricted to pure numeric values or to putting one character in each cell. If that situation applies to you then consider using writetable()
4 件のコメント
Walter Roberson
2019 年 4 月 15 日
Is it possible those were already in the spreadsheet? Xlswrite does not remove content from cells it is not writing to.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!