a simple question about for loop
2 次查看(过去 30 天)
显示 更早的评论
hello all,
i want to use xlswrite function in a for loop ? but i don not know how to name the variable in for
for example ;
for a = (1:10)
xlswrite( 'deneme.xls',writeEx , 1, 'A??')
end
maybe it is simple but very important for my project now. i am looking forwart to hear your answer.
thank you a lot
1 个评论
Walter Roberson
2012-7-19
Why are you writing the same value, "writeEx", multiple times?
Is "writeEx" a scalar or a vector or a matrix? Are you trying to write it across rows or down columns or something else?
回答(2 个)
Azzi Abdelmalek
2012-7-19
for i=1:10
writeEX=rand(10,10); %exemple of random matrix
xlswrite( 'deneme.xls',writeEX ,['Sht',num2str(i)],'A5')
end
% ['Sht',num2str(i)] are the sheet 1 2 3 ... named sht1 sht2 ...
% 'A5' data start at the fifth line of colon A
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!