How to overwrite an excel file, matlab 2018?
조회 수: 9 (최근 30일)
이전 댓글 표시
I need to overwrite an excel file each time write table function runs but I don’t have Matlab 2020. And I cannot delete the file as I am later using it to be uploaded in my app for creating a table in my app.
How can I solve the problem
댓글 수: 4
Image Analyst
2023년 12월 25일
Then just call the writetable function over and over again. It will overwrite the existing file.
답변 (1개)
Sulaymon Eshkabilov
2023년 12월 25일
Here is one code if understood your question correctly:
FName = 'Renew_Table.xlsx';
D = array2table(randi(255, 7, 3))
writetable(D,FName,'Sheet',1);
for ii=1:3
D = readtable(FName);
D{:,:} = D{:,:}*ii;
writetable(D,FName,'Sheet',1);
end
D = readtable(FName)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!