skydiver_func6 - v = sqrt(m*g/c*tanh(sqrt(g*c/m*t Save time...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 function v = skydiver_func6 % 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) % Read inputs from a data file called data.txt data = load('data.txt') nrows = size(data,1) m = data(1,1) g = data(2,1) c = data(3,1) t = data(4:nrows,1)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: v = sqrt(m*g/c)*tanh(sqrt(g*c/m)*t) % Save time and calculated speed vectors to a text file save speeds1.txt t v -ascii -double -tabs % data in one long column outputs = [t v] save speeds2.txt outputs -ascii -double -tabs % Save time and calculated speed vectors to a text file % as two formatted columns fid = fopen('speeds3.txt','w') fprintf(fid,' Time Speed\n') fprintf(fid,' %3.1f %5.2f\n', t, v) fclose(fid)...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online