MATLAB: Is UIAxes default interactivity disabled with WindowScrollWheelFcn

MATLAB

Why do default interactions (pan, zoom, etc.) for UIAxes become disabled when declaring hardware callbacks such as WindowScrollWheelFcn? To illustrate, compare the behaviors in the following two examples:
f1 = uifigure;
ax1 = uiaxes(f1);
surf(ax1,peaks); %default interactions are enabled
f2 = uifigure;
ax2 = uiaxes(f2);
surf(ax2,peaks);
f2.WindowScrollWheelFcn = 'disp("hello")'; %disables default interactions such as pan, rotate, etc.

Best Answer

This is currently the expected behavior. Here are two possible workarounds:
1) Enable the interactions via the axes toolbar ("axtoolbar"), which is available in R2018b and later. The interactions can be enabled by clicking the desired control in the toolbar.
2) Alternatively, enable the specific interaction programatically, as exemplified below:
%enable pan
pan(ax2, 'on');
%enable rotate
rotate3d(ax2, 'on');
% enable zoom
zoom(ax2, 'on');
Note: This method only allows one interaction (pan, zoom, rotate, etc.) to be enabled at a time.