Each time I run my code in matlab it produces 2 matrices: W1 (20 x 1) and W2 (20 x 1).I want to aytomatically pass the values of these 2 matrices in an existing excel file, which is called: default1.xlsx and it is located in my desktop.Additionally, I want to pass the values of the matrices in certain cells in excel,i.e B3:B22 for W1 and C3:C22 for W2.Can anyone share with me the appropriate code for this in order to avoid the copy/paste command ?
Any help could be useful. Thanks in advance!

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2015년 3월 11일

1 개 추천

Try it
xlswrite('default1.xlsx',[W1,W2],1,'B3:C22');

댓글 수: 3

Konstantinos
Konstantinos 2015년 3월 11일
Thanks a lot! but if I want W1 to sheet 1 and W2 to sheet 2 ?
Andrei Bobrov
Andrei Bobrov 2015년 3월 11일
편집: Andrei Bobrov 2015년 3월 11일
xlswrite('default1.xlsx',W1,1,'B3:B22');
xlswrite('default1.xlsx',W2,2,'С3:C22');
Konstantinos
Konstantinos 2015년 3월 11일
I really appreciate your help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

질문:

2015년 3월 11일

댓글:

2015년 3월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by