How to clear GUI variables?
24 views (last 30 days)
I'm trying to clear GUI variables. From what I understand, each callback function has its own workspace and separate global workspace. I'd like to clear a specific callback variables with a push button. (Callback function is blockremover_callback, I'd like to reset with a push button).
function clearscreen_Callback(hObject, eventdata, handles)
global xy h binary
xy = ;
h = ;
binary = ;
Image Analyst on 18 Dec 2013
You can clear global variables with clear global.
clear global xy;
clear global h;
clear global binary;
After you clear them, if you need them you need to declare them again:
There is no need to clear local variables as they vanish once the function exits.
More Answers (1)
Walter Roberson on 17 Dec 2013
No, there is only one global workspace.
Each function may have its own persistent variables. Those variables may be cleared by using "clear" together with the function name.