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?
No products are associated with this question.
You can use the command or the function syntax. If the variable names are the values of string variables then command syntax cannot be used.
it prints to the command window
Name Size Bytes Class Attributes a 1x1 8 double
function save_test a = 1; b = 2; Save_Xallback whos -file save_test.mat end function Save_Xallback evalin( 'caller', 'save save_test.mat a' ); end
Answer to the first comment:
The above is a hint rather than a complete answer. I don't exactly understand what you want to achieve. Variables of which workspace do you want to save? Outline a simple example in code. Some basics:
Command and Function syntax
"I'm thinking ... : evalin('caller','save save_test.mat variables')"
"... save the workspace while in any function?"
I believe it is difficult to save the complete "state" of a running Matlab program. Special cases maybe.
Play games and win prizes!Learn more