Set the Variable 'Global' in GUI?
Show older comments
I'm working with MATLAB GUI.
When I'm trying to access the variable which was defined with the push button, it is not defined in the pop up menu. The variables; it should be set 'global', so it is defined in the whole program. And I can use it in any callback.
Do you guys have any idea of how to make the variables 'global'?
Your help will be much appreciated.
Thank you.
Accepted Answer
More Answers (1)
Image Analyst
on 12 May 2013
Just say
global yourVariable;
in any function that needs to access the variable.
Categories
Find more on Interactive Control and Callbacks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!