%% Set x-Axis Limits for Specific Axes
% Starting in R2019b, you can display a tiling of plots using the tiledlayout and nexttile functions. Call the tiledlayout function to create a 2-by-1 tiled chart layout. Call the nexttile function to create the axes objects ax1 and ax2. Plot data into each axes. Then set the x-axis limits for the bottom plot by specifying ax2 as the first input argument to xlim.

tiledlayout(2,1)
x = linspace(0,5,1000);
y = sin(100*x)./exp(x);
ax1 = nexttile;
plot(ax1,x,y)

ax2 = nexttile;
plot(ax2,x,y)
xlim(ax2,[0 1])

% Copyright 2019 The MathWorks, Inc.