MATLAB: How to link 2 3D subplots to sync zoom and pan

3dlinkpropzoom

Hey every one,
I am trying to link two 3D subplots such that when I rotate, pan or zoom on one of the subplot, the other one will automatically sync to the changed new camera view and axis limits. I came across this solution for syncing camera view when rotating: https://de.mathworks.com/matlabcentral/answers/12171-how-to-link-cameras-for-two-subplots-in-a-single-figure
Using the above solution, rotations can be synced. But when I try to zoom in on one of the subplots, the other subplot doesn't stay on the same position in the figure, it moves around. The same also happpens, when I try to pan one subplot. And when zooming in, the other subplot doesn't sync it's axes limits.
For 2D subplots, linkaxes seems to do the job. So what is the solution for the 3D case?
Below is a example code to illustrate the problem
ax1 = subplot(1, 2, 1);
[x,y,z] = peaks;
surf(x,y,z);
ax2 = subplot(1, 2, 2);
[x,y,z] = peaks(10);
surf(x,y,z);
Link = linkprop([ax1, ax2],{'CameraUpVector', 'CameraPosition', 'CameraTarget'});
setappdata(gcf, 'StoreTheLink', Link);
Any help will be appreciated.

Best Answer

As Adam suggested in the comments, this seems to work:
ax1 = subplot(1, 2, 1);
[x,y,z] = peaks;
surf(x,y,z);
ax2 = subplot(1, 2, 2);
[x,y,z] = peaks(10);
surf(x,y,z);
Link = linkprop([ax1, ax2],{'CameraUpVector', 'CameraPosition', 'CameraTarget', 'XLim', 'YLim', 'ZLim'});
setappdata(gcf, 'StoreTheLink', Link);