MATLAB: Save base workspace MAT file from GUI

base workspacecallbackguisave

Guys –
I'm writing a GUI in which I'd like to put a pushbutton to save the entire base workspace to a .mat file. Problem is I don't know how to do that from the GUI subfunction workspace. Can anyone point me to the right approach or write a couple lines I can put in the pushbutton's callback function to save the base workspace as .mat?

Best Answer

I do not think, that this method have enough control over what is written. But if you really want to save the base workspace to a MAT file:
evalin('base', 'save(''FileName.mat'')');