Save a "storage variable" in a different .mat file
2 views (last 30 days)
Show older comments
Hi all, I am running an iterative algorithm and I am saving the results of each iteration in a "storage variable", which is a cell-array called MC. Since I am running many iterations the storage variable MC becomes significantly big, slowing down a lot my algorithm. So I was wondering: is there a way to save my storage variable in a .mat file (maybe every TOT iteration), so that I can delete it and fasten my algorithm?
I know of the function "save" but I need to be able to write the new .mat file "incrementally" (in the sense that I'd like to be able to increase the variable defined in the new .mat file each time I save the MC variable not to overwrite it).
Is it possible?
Thanks!
P.S. I am not using the Parallel Toolbox, so no problems with different clusters and similars.
0 Comments
Answers (1)
Walter Roberson
on 16 Sep 2015
You could look at matFile() in particular http://www.mathworks.com/help/matlab/ref/matfile.html#bt19yqz-1. But pay attention to the Limitations -- so you might need to switch to a structure array
0 Comments
See Also
Categories
Find more on Workspace Variables and MAT-Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!