%% Display Grid Lines on Specific Axes
% Create a figure with two subplots and assign the Axes objects to the variables ax1 and ax2. Plot a sine wave in each subplot. Then display the grid lines on the upper subplot by specifying ax1 as an input argument to the grid function.

x = linspace(0,10);
y = sin(x);
ax1 = subplot(2,1,1);
plot(ax1,x,y)

y2 = sin(3*x);
ax2 = subplot(2,1,2);
plot(ax2,x,y2)

%

grid(ax1,'on')

% Copyright 2015 The MathWorks, Inc.