%% Set z-Axis Limits for Specific Axes
% Create a figure with two subplots and assign the Axes objects to variables ax1 and ax2. Plot the same data in each subplot. Set the z-axis limits for the bottom subplot by specifying ax2 as the first input argument to zlim.

[X,Y,Z] = peaks;
ax1 = subplot(2,1,1);
surf(X,Y,Z)

ax2 = subplot(2,1,2);
surf(X,Y,Z)
zlim(ax2,[-5 5])

% Copyright 2015 The MathWorks, Inc.