필터 지우기
필터 지우기

writing multiple rows to excel sheet

조회 수: 4 (최근 30일)
Sajitha K.N.
Sajitha K.N. 2020년 3월 5일
답변: Walter Roberson 2020년 3월 5일
I have a dataset. I extracted features from it. Now I want to write it into an excel sheet. But only last row of combined vector is writing into excel file.I put xlswrite() function after loop only. How can solve this problem?
  댓글 수: 7
Sajitha K.N.
Sajitha K.N. 2020년 3월 5일
편집: Sajitha K.N. 2020년 3월 5일
This is the code
darova
darova 2020년 3월 5일

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

답변 (1개)

Walter Roberson
Walter Roberson 2020년 3월 5일
xlswrite('Grape_blackMeasles.xlsx', combined_vector)
Tells MATLAB to overwrite all of the sheet 1 in that xlsx file with the current content of combined_vector.
There is no option for xlswrite() or writetable() or related functions to append to an xlsx file from where-ever the current end happens to be. You have two options:
  1. read in all of the current content, append your new data in memory, and write out the combined data; or
  2. somehow figure out where the end of the current content is, and use the range specification of xlswrite() or writetable() to tell MATLAB where to write the new data.
If you are writing data in a loop starting from an empty sheet, then you can keep track of how many rows you have written so far in order to know where to start writing new rows.

카테고리

Help CenterFile Exchange에서 Agriculture에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by