How do I write in different cell locations each time xlswrite function is executed in a for loop?
1 次查看(过去 30 天)
显示 更早的评论
How do I write in different cell locations each time xlswrite function is executed in a for loop?
0 个评论
采纳的回答
Oleg Komarov
2011-2-8
Specify the range in Excel format:
xlswrite(filename, M, range)
An example (really basic, and optimizable):
for ii = 1:4
% Create random matrix
A = rand(ii);
% toplefts
toplefts = cumsum(0:ii-1)+1;
% Range
range = XLSrange(size(A),[toplefts(ii),1]);
xlswrite('C:\Users\Oleg\Desktop\trial.xlsx',A,'Sheet1',range)
end
Oleg
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!