First you must find all the children of the toolbar. You can do this with the following command (Assuming currentToggleButton is the handle of the current toggle button):
get( get(currentToggleButton,'Parent'),'Children');
Then follow these steps:
set(children,'State','off');
Of course, you need to return the state of the current button to on .
set(currentToggleButton,'State','on');
By the way, if you use GUIDE, you can add zoom , rotate and pan as predefined tools. In this case, Matlab will automatically switch.
To disable the zoom / pan / rotation effect, you can do:
zoom('off') pan('off') rotate3d('off')
or you can use a different version of the syntax (as @Eitan mentions)
zoom off pan off rotate3d off
source share