MATLAB: Passing a Workspace out of a Callback function to the Base workspace

callbackworkspace transfer

I am trying to pass a callback function workspace to the base MATLAB workspace. The function calls a script that accesses a database and downloads the data needed to run the program. The script works fine when I call it from the base MATLAB workspace, I just have no (easy) way to pass the callback function workspace to the base workspace when it is called from a pushbutton uicontrol. Any thoughts on how to do this?
The thread below makes it sounds like there is not an easy way to do it:
I am aware of evalin and assign in, but I have quite a bit of info to pass. I would much rather not go through a convoluted process of assigning and reassigning variable/structs to do this.
Thanks for any help.

Best Answer

vars_here = who;
for varidx = 1 : length(vars_here)
assignin('base', vars_here{varidx}, eval(vars_here{varidx}));
end