How to save for loop data to same excel file of variable?
7 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
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
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
2022-11-18
In current releases I would use writetable or writematrix or writecell, with the option WriteMode 'append'
更多回答(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!