%% Plot Vertical Line in Specific Axes
% Create subplots with cosine and sine waves, then add a vertical line to the cosine plot.  Label the line as 'cos(\pi/2)=0'.

ax1 = subplot(2,1,1);
x = linspace(0,2*pi,200);
y1 = cos(x); 
plot(ax1,x,y1)

ax2 = subplot(2,1,2);
x = linspace(0,2*pi,200);
y2 = sin(x); 
plot(ax2,x,y2)

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

%
% Add a line to the sine subplot.

xlsine = xline(ax2,pi,':','sin(\pi)=0');

% Copyright 2018 The MathWorks, Inc.