- call xlswrite twice with each array and a RANGE argument to not overwrite the first with the second, or
- create a composite array that contains all the data in the desired locations to be written within that array
How to write Multiple data to Excel
조회 수: 4 (최근 30일)
이전 댓글 표시
Please how can i write multiple data to excel file. I used xlswrite for
filename = 'testdata.xlsx';
A = [12.7;5.02;-98;63.9;0;-.2;56];
xlswrite(filename,A)
and it worked.
But when I add B it generates an error
filename = 'testdata.xlsx';
A = [12.7;5.02;-98;63.9;0;-.2;56];
B= [1 2 3 4 5 6 7];
xlswrite(filename,A,B)
How can I do this please?
댓글 수: 0
답변 (1개)
dpb
2019년 6월 13일
편집: dpb
2019년 6월 14일
xlswrite is documented to accept one array for output...you've got two disparate pieces of data to place in the spreadsheet--you'll have to either
We can't tell from the limited info just what you expect result to be...see the doc for details of alternate syntax for sheet and range as well as examples with cell arrays to build composite output arrays that are supported.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!