Inaccurate results when writing xls through writetable
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello everyone.
I am using Matlab R2021b. I write then save .xls files from a table using writetable. After saving, I write again on the same file but without deleting the older version first. If I do so, I get strange results in some cases, e.g., the last cell gets duplicated, some characters are added to some cells. If I delete the older version before saving the new one, I have no issues. Is this a known issue?
댓글 수: 2
Image Analyst
2022년 5월 21일
I've never noticed that. You're writing the very same array both times, right? Not a smaller one the second time, which would leave the existing cells that don't get written over? You're specifying the upper left cell the same both times, right, like 'A1'? Can you attach your data in a .mat file and attach the code that demonstrates what you think is the problem? Can you download the latest version (R2022a) and try it there also?
채택된 답변
Voss
2022년 5월 21일
From the documentation for writetable:
- If filename is the name of an existing spreadsheet file, then the writing function writes the data to the specified location, but does not overwrite any values outside the range of the input data.
Does that explain the behavior you are seeing?
추가 답변 (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!