function dudt = f_nodrag(t, u) % equations of motion for baseball in flight without air resistance g = 9.8; % acceleration of gravity m/s^2 % extract components of vector u into variables x, y, vx, vy x = u(1); y = u(2); vx = u(3); vy = u(4); % compute rates of change of those components dxdt = vx; dydt = vy; dvxdt = 0.0; dvydt = -g; % pack rates of change back into vector dudt, return value of function dudt = [dxdt; dydt; dvxdt; dvydt]; end