MATLAB: How to programmatically reset the state of the figure’s toolbar in MATLAB 7.8 (R2009b)

MATLABresettoolbaruitoggletooluitoolbar

I have programmed a GUI and at a certain state of the GUI I would like to programmatically reset all the toolbar buttons to the 'off' state.

Best Answer

We recommend the following set of commands to programmatically reset the state of the figure toolbar.
If the figure handle is assigned to the variable 'f' (this would likely be handles.figure1 for a GUIDE GUI), then the following commands should reset the toolbar:
pan(f,'off')
zoom(f,'off')
rotate3d(f,'off')
datacursormode(f,'off')
brush(f,'off')
Please note that low-level commands that manipulate the state of the toolbar buttons can result in unstable GUI behavior and are not recommended for direct use.