MATLAB: Variable: global or in guidata

global gui variablesMATLAB

which is more useful in gui programming, to save the variable in handles structure or to make it global to have access on it?

Best Answer

I would suggest you avoid global variables. They are more powerful than what you need, and therefore probably not the best choice. The FAQ has a couple of suggestions: