필터 지우기
필터 지우기

How to save for loop data to same excel file of variable?

조회 수: 4 (최근 30일)
Swapnil Rane
Swapnil Rane 2018년 4월 1일
댓글: Walter Roberson 2022년 11월 18일
In my code for every for loop a output variable is calculated. So, I want to save the data of each loop in same sheet after the last line in excel. Is there any way to do so?

채택된 답변

Walter Roberson
Walter Roberson 2018년 4월 1일
If you are using MS Windows with Excel installed then see https://www.mathworks.com/matlabcentral/fileexchange/28600-xlsappend
However, I would recommend that you consider saving all of the results in an array and appending only once all of the values are known, as the communication with Excel is comparatively expensive.
  댓글 수: 3
Parthiban Arumugam
Parthiban Arumugam 2022년 11월 18일
could you please explain how to call this function (above link) ?
can you put some example code here, if possible ?
Walter Roberson
Walter Roberson 2022년 11월 18일
In current releases I would use writetable or writematrix or writecell, with the option WriteMode 'append'

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by