1
8.31 The altitude of the space shuttle during the first two minutes of its ascent is displayed in the follow-
ing table (www.nasa.gov):
Assuming the shuttle is moving straight up, determine its velocity and acceleration at each point. Display
the results in three plots (h versus time, velocity versus time, and acceleration versus time).
(a) Solve by using the user-defined function FrstScndDerivPt that was written in Problem 8.19.
(b) Solve by using the MATLAB built-in function diff.
Solution
(a) The following scripts file uses the user-defined function FrstScndDerivPt that was written in
Problem 8.19 (b) to solve the problem. (The user-defined function FrstScndDerivPt was modified
such that the axes labels correspond to the variables in the current problem.)
t (s) 010 20 30 40 50 60 70 80 90 100 110 120
h (m) –8 241 1,244 2,872 5,377 8,130 11,617 15,380 19,872 25,608 31,412 38,309 44,726