Global (shared) variables in Matlab GUI code behind. Is there better way to do it then using handles structure?
I have spent some time lately creating complex Matlab GUI tool. I'm using GUIDE GUI builder. I dislike the way Matlab manages global variables in code behind (the .m file with functions). If I want to share data between function calls I have to store them in handles structure that is given as a parameter to every function call. I consider it to be bug prone as I have to mind storing and updating handles all the time. It is rather unnatural for me to handle global variables this way. Using appdata is even worse. Is it possible to use class as a code behind for GUI? All the callbacks would be