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?

採用された回答

Oleg Komarov
Oleg Komarov 2011 年 2 月 8 日
Specify the range in Excel format:
xlswrite(filename, M, range)
To help specifying the range I use XLSrange
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

その他の回答 (1 件)

vish
vish 2011 年 2 月 8 日
Can you pleas elucidate on XLSrange with a small example. Thank you.

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by