フィルターのクリア

writing multiple 2D matrices in 1 excel file

5 ビュー (過去 30 日間)
Ananya Malik
Ananya Malik 2017 年 8 月 28 日
編集済み: KL 2017 年 8 月 28 日
I have multiple variables containing 2D data that I want to write in either xls or txt file.
Suppose in each iteration I get A = [50x2], B=[10x2], C=[13x2], D=[11x2], E=[15x2], I want to write all this data in the same excel sheet. Is it possible. Any help appreciated. TIA.

採用された回答

KL
KL 2017 年 8 月 28 日
編集済み: KL 2017 年 8 月 28 日
sheetA = 1;
sheetB = 2;
xlswrite(filename,A,sheetA)
xlswrite(filename,B,sheetB) %and so on

その他の回答 (1 件)

KSSV
KSSV 2017 年 8 月 28 日
A = rand(10,3) ;
B = rand(3,3) ;
dlmwrite('test.txt',A,'-append')
dlmwrite('test.txt',B,'-append')
  1 件のコメント
Ananya Malik
Ananya Malik 2017 年 8 月 28 日
編集済み: Ananya Malik 2017 年 8 月 28 日
Thank you. This code appends everything without clear distinction. I would prefer the data to be in columns. Hence maybe excel sheet would be a better choice right?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by