%% Specify Axes for Line Plot
% Create a figure with two subplots and return the Axes objects as ax1 and ax2. Create a 2-D line plot in each axes by referring to the Axes objects. Add a title and y-axis label to each axes by passing the Axes objects to the title and ylabel functions.

ax1 = subplot(2,1,1); % top subplot
x = linspace(0,3);
y1 = sin(5*x);
plot(ax1,x,y1)
title(ax1,'Top Subplot')
ylabel(ax1,'sin(5x)')

ax2 = subplot(2,1,2); % bottom subplot
y2 = sin(15*x);
plot(ax2,x,y2)
title(ax2,'Bottom Subplot')
ylabel(ax2,'sin(15x)')

% Copyright 2015 The MathWorks, Inc.