Save a "storage variable" in a different .mat file

2 views (last 30 days)
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.

Answers (1)

Walter Roberson
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

Tags

Community Treasure Hunt

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

Start Hunting!