Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
output results to different excel sheets
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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.
0 commentaires
Réponses (1)
Azzi Abdelmalek
le 15 Août 2013
Modifié(e) : Azzi Abdelmalek
le 15 Août 2013
for i = 1:5
X=y(:,i);
xlswrite('output',X,sprintf('factor_%d',i);
end
%or you can use
strcat('factor_',num2str(i))
2 commentaires
Azzi Abdelmalek
le 15 Août 2013
Modifié(e) : Azzi Abdelmalek
le 15 Août 2013
% sprintf('factor_%s',i) is for characters
e.g
i='r'
sprintf('factor_%s',i)
% for numbers use
i=3
sprintf('factor_%d',i)
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!