フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

output results to different excel sheets

1 回表示 (過去 30 日間)
Linden
Linden 2013 年 8 月 15 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi I want to output my results to different excel sheets. All sheets share the same prefix plus a number to distingush them. For example,
for i = 1:5
X=y(:,i);
xlswrite('output',X,factor_i);
end
How can I make Matlab create sheets like factor_1, factor_2,...
Thanks.

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 8 月 15 日
編集済み: Azzi Abdelmalek 2013 年 8 月 15 日
for i = 1:5
X=y(:,i);
xlswrite('output',X,sprintf('factor_%d',i);
end
%or you can use
strcat('factor_',num2str(i))
  2 件のコメント
Linden
Linden 2013 年 8 月 15 日
Thanks very much. I actually tried sprintf('factor_%s',i). Didn't work.
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 8 月 15 日
編集済み: Azzi Abdelmalek 2013 年 8 月 15 日
% sprintf('factor_%s',i) is for characters
e.g
i='r'
sprintf('factor_%s',i)
% for numbers use
i=3
sprintf('factor_%d',i)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by