필터 지우기
필터 지우기

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 CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by