フィルターのクリア

how to write certain rows in excel using xlswrite

6 ビュー (過去 30 日間)
live to l e a r n  MATLAB
live to l e a r n MATLAB 2012 年 10 月 5 日
This is my values A:1 4 2 5 3 6 8 7 9 10 1 2 11 13 14 15 and
for i=1:1:16
xlswrite('filename.xlsx',A)
end
and here my excel sheet having one values only:15
but am needed 1 4 2 5 3 6 8 7 9 10 1 2 11 13 14 15

採用された回答

live to l e a r n  MATLAB
live to l e a r n MATLAB 2012 年 10 月 5 日
nothing happened

その他の回答 (2 件)

Muruganandham Subramanian
Muruganandham Subramanian 2012 年 10 月 5 日
Hi kesavan,
Insteadof writing it as 'filename.xlsx' .try it as 'filename.xls'

Image Analyst
Image Analyst 2012 年 10 月 5 日
Does that mean your question is figured out? I mean, you just wrote the same array of 15 numbers out to the same workbook/worksheet 16 times in a row, so what were you expecting?
Or maybe A is just a scalar, not an array and you wanted each element in a different row. Like this:
for k = 1 : 16
cellReference = sprintf('A%d', k);
xlswrite('filename.xlsx', A(k), cellReference)
end
But you don't want to use xlswrite that many times unless you're willing to have it be very slow because it has to launch and shutdown Excel every iteration in your loop. You'd want to use xlswrite1 (File Exchange) and ActiveX programming.

カテゴリ

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