%% Add Title to 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. Then plot data into each axes.

tiledlayout(2,1)
ax1 = nexttile;
plot(ax1,(1:10).^2)
ax2 = nexttile;
plot(ax2,(1:10).^3)

%
% Add a title to each axes by passing ax1 and ax2 to the title function.

title(ax1,'Top Plot')
title(ax2,'Bottom Plot')

% Copyright 2019 The MathWorks, Inc.