function v = skydiver_func5(m,g,c,t) % Function to calculate skydiver falling speed % for specified parameter values and time vector % using the analytic solution. % % Inputs: mass m (kg) % gravity g (m/s^2) % drag coefficient c (kg/m) % time vector (s) % % Outputs: falling speed vector v (m/s) v = sqrt(m*g/c)*tanh(sqrt(g*c/m)*t); % Create formatted outputs for final velocity and final time npts = size(t,1); vf = v(npts,1); tf = t(npts,1); fprintf('The final falling speed is %5.2f m/s at time %d sec\n', vf, tf) pause % Create formatted table for all time and speed values fprintf(' Time Speed\n') fprintf(' %3.1f %5.2f\n', t, v)