Write to Existing Multiple Excel file via Range and Sheet
이전 댓글 표시
How can i overwrite Multiple Excel file specifying the Range and Sheet. There is a pre-added data on the A.xls and B.xls C.xls and I want to override it with the following matrix. Thanks
For example:
xlswrite
File A.xls
Sheet 1- Range B2:F6
matA1=[1 2 3 4 5;1 2 3 4 5 ;1 2 3 4 5]
Sheet 2 -Range A2:E6
matA2=[2 2 2 3 2;2 2 4 2 2 ;2 2 1 2 2]
File B.xls
Sheet 1- Range B2:F6
matA1=[1 2 3 4 5;1 2 3 4 5 ;1 2 3 4 5]
Sheet 2 -Range A2:E6
matA2=[2 2 2 3 2;2 2 4 2 2 ;2 2 1 2 2]
File C.xls
Sheet 1- Range B2:F6
matA1=[1 2 3 4 5;1 2 3 4 5 ;1 2 3 4 5]
Sheet 2 -Range A2:E6
matA2=[2 2 2 3 2;2 2 4 2 2 ;2 2 1 2 2]
댓글 수: 3
Bob Thompson
2018년 8월 21일
편집: Bob Thompson
2018년 8월 21일
Is the above matlab code? As far as I'm aware, the print command is used to physically print something, not save to a file.
If you are looking for the command to write some data to an excel file look at xlswrite(). It automatically overwrites whatever is within the specified range when it writes the new data.
joms
2018년 8월 22일
Bob Thompson
2018년 8월 22일
https://www.mathworks.com/help/matlab/ref/xlswrite.html This is the page for xlswrite(). It has options for choosing file, sheet, and range.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!