MATLAB: How to pass variable from GUI to matlab workspace

globalguiworkspace

The global function is nice, for example:
(in GUI):
global y
y=5;
and then in matlab command window i type global y and it is done.
The way I want to do it is that y is automatticaly printed in workspace without me typing global y in command window. Can it be done?
Thanks.

Best Answer

don't use semicolon ;
y=5