MATLAB: How do i determine if the uiaxes toolbar is active

app designerMATLABuiaxes toolbar

I am developing an app which grabs points from a uiaxes object based on mouse-clicks within the uiaxes. However, if I select one of the uiaxes toolbar tools (eg zoom or pan) then I need to suspend interpreting mouse clicks for grabbing points until I have stopped using the uiaxes toolbar. How do I do this?
Basically I need to know if the UIAxes toolbar is currently active.
Thanks in advance for any help.

Best Answer

Hi,
I suggest using 'SelectionChangedFcn' callback. This is notified whenever a state button(zoom/pan) is clicked, and you can know which button is clicked. You can also write your custom MATLAB code in the callback associated.
Refer the documentation link for more details: