%% Add Lines to Different Axes
% 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 into each of the axes. Add a dotted vertical line and label to each plot by passing the axes to the xline function.

tiledlayout(2,1)
ax1 =nexttile;
x = linspace(0,10,200);
y1 = cos(x); 
plot(ax1,x,y1)

ax2 = nexttile;
y2 = sin(x); 
plot(ax2,x,y2)

xline(ax1,pi/2,':','cos(\pi/2)=0');
xline(ax2,pi,':','sin(\pi)=0');

% Copyright 2019 The MathWorks, Inc.