function yp = sys1(t,y,g)
%
% Right-hand side function for a system of first-order
% differential equations. There are 2 dependent
% variables, y(1) and y(2), so there are 2 derivatives
% that need to be evaluated, yp(1) and yp(2)
yp(1) = y(2); % Compute derivative of y1
yp(2) = -g; % Compute derivative of y2
% The statement below ensures that yp is a column
% vector
yp = yp(:);