The issue you are running into is due to this line of code:
linkprop([ax(1), ax(2)], {'XLim', 'YLim','Position', 'View'});
That line of code is setting the Position property on the axes, which switches the PositionConstraint from 'outerposition' to 'innerposition'.
f = figure; t = tiledlayout(1,1); ax(1) = axes(t); p = pcolor(ax(1), peaks); set(p, 'EdgeColor', 'none', 'FaceAlpha', 1); set(ax(1), 'Colormap', bone); cb(1) = colorbar(ax(1)); cb(1).Layout.Tile = 'east'; ax(2) = axes(t); p2 = pcolor(ax(2), peaks); set(p2, 'EdgeColor', 'none', 'FaceAlpha', 0.5); set(ax(2), 'Colormap', copper); cb(2) = colorbar(ax(2)); cb(2).Layout.Tile = 'north'; ax(2).Visible = 'off'; ax(1).XAxis.FontSize = 14; ax(1).YAxis.FontSize = 14; ax(2).XAxis.FontSize = 14; ax(2).YAxis.FontSize = 14; ax(1).FontSize = 14; ax(2).FontSize = 14; xlabel(ax(1),'x(\mum)'); ylabel(ax(1),'y(\mum)');

Note: When you call linkprop, you have to store the output handle, otherwise the link will be broken immediately. The output from linkprop is a link object that "owns" the link. If you don't store that object, then the link object will be stored in ans, but that will be cleared as soon as the next command runs. Once that link object is cleared, the link will be broken.
link = linkprop([ax(1), ax(2)], {'XLim', 'YLim','View'});
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Explore similar technical troubleshooting questions and verified MATLAB solutions: