saving everything in the workspace
Show older comments
Hi, the save comand only saves the variables, handles, etc. However I need to save everything in the workspace including struct, doubles, etc...everything.
Also, once everything is saved I would like to load everything exactly the way it was saved. Would all this be possible?
Thank you
9 Comments
Image Analyst
on 30 May 2013
Do you think structures and doubles are not variables???
Walter Roberson
on 30 May 2013
What struct or double exists in the workspace that is not inside a variable ?
Image Analyst
on 30 May 2013
I would be surprised if it only saved the handles, hObject, and eventdata and nothing else. But why save everything inside a callback? Why not save only the variables that you need to recall later? And it will only save local variables by default so where are you planning on recalling these variables? In the same function? Or a different function to "poof" those variables into existence?
per isakson
on 30 May 2013
Edited: per isakson
on 30 May 2013
save in Save_Callback will save the variables in the workspace of Save_Callback. Wouldn't you need something like
evalin( 'caller', 'save...' )
whether smelly or not
Walter Roberson
on 30 May 2013
per is correct.
Image Analyst
on 30 May 2013
At the point that you call save() you should have hObject, eventdata, handles, and filename, and pathname as the only variables in existence. It's a mystery to me why filename and pathname do not get saved into the mat file. The help file says "save(filename) stores all variables from the current workspace in a MATLAB® formatted binary file (MAT-file) called filename." So, if like you say, only the first three variables are being stored and able to be recalled and the latter two aren't, I'd call the Mathworks about it. But first see if you can open that mat file in any other script or from the command line and see what gets returned.
Accepted Answer
More Answers (0)
Categories
Find more on Whos 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!