How to print out tabulated data to excel

2 ビュー (過去 30 日間)
yp78
yp78 2018 年 8 月 12 日
編集済み: yp78 2018 年 8 月 18 日
Is there any way by which I can export (print) the output of tabulated data? My current code looks like this and returns an error message saying; "Error using xlswrite (line 172) input data must be a numeric, cell, or logical array".
% The "result" is N by 1 double array
C = categorical(result,[2 3 4 5 6],{'Mon','Tue','Wed','Thu','Fri'});
tabulate(C)
% print output
fileName= 'output.xlsx';
sheetName = 'sheet1';
xlswrite(fileName,C,sheetName,'B3');
  3 件のコメント
dpb
dpb 2018 年 8 月 13 日
That would overwrite the variable which is ok if that's what's wanted...
xlswrite(fileName,tabulate(C),sheetName,'B3');
will just output the result. Seems to work but while xlsread/write are always pretty slow, xlsread() of that particular output hung here first time and took some 30 sec to return the next. Don't know whassup w/ that...
yp78
yp78 2018 年 8 月 18 日
編集済み: yp78 2018 年 8 月 18 日
Thanks for your help! It worked and I found each one of your advice helpful.

サインインしてコメントする。

回答 (1 件)

KSSV
KSSV 2018 年 8 月 13 日

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by