How can I save data to a .mat file the variables of the old .mat files aren't lost after saving new ones?
32 次查看(过去 30 天)
显示 更早的评论
In my program, I need to save variables in each for loop and I want to save all variables after run all for loops in file result.mat. Howerver, when I save new variables, variables in previous for loop are lost. How can I save all data after finishing all for loop? Thank for your help!
0 个评论
回答(1 个)
Azzi Abdelmalek
2016-4-30
Use append option
a=10;
save('file','a')
b=20;
save('file','b','-append')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!