MATLAB: How to pass variable through functions in gui

Image Processing Toolboxmatlab guivariables

when i use GUI I was have hard time with something. When I press a push button, a series of calculations are performed. After that, when a different button is pushed, I need to use some of the variables created when the previous button was pushed. Thanks,
Related Question