From: Adam Cutbill on
Hi,
This problem a bit complex, so I've provided some background,

I have a function which iteratively saves the workspace to a file so that the user can easily take off where they left off if they want to stop the program. This works so far by saving to a kind of temporary/placeholder file (called currentData.m) each iteration. Then, when the user clicks the resume button (from a GUI), a handle is changed to alert the iterative program to load from a file instead of starting a fresh run and the iterations start where they left off. (resumeStatus='y' instead of 'n'). This means the program runs again with the past data instead of starting new. This is working great now, but I want to merge this with another saving method.

My other method saves the contents of GUI text boxes to a .mat file (the name is chosen by the user-let's call it user.mat for now). This serves a different purpose: to let the user load past problem setups instead of having type all the input parameters again. I would like to also save the current iterative data to this file.

What I am doing to merge the two is while saving the GUI textboxes the contents of currentData.m is loaded( t=load(currentData.m) ), then also saved to a structure in the user.mat file. This is also working fine. I have a bunch of textboxes in my mat file and t (the iterative data).

Finally, my problem is when loading, I am trying to overwrite the contents of currentData.m with the structure saved by the user in user.mat (t). I am only to load/save t, but I would like to save its contents not the structure itself. There are too many variables to manually load each one, is there a way to load the contents from a structure within a .mat? Another way of accomplishing this?

Thank you very much for any advice,

Adam
 | 
Pages: 1
Prev: MATLAB indexing issue
Next: Problem with GUI