The distance a freely falling object travels is x = 1/2 gt^2 where g - accelerat
ID: 3804526 • Letter: T
Question
The distance a freely falling object travels is x = 1/2 gt^2 where g - acceleration due to gravity, 9.8 m/s^2 t - time in seconds x - distance traveled in meters. If you have taken calculus, you know that we can find the velocity of the object by taking the derivative of the preceding equation. That is, dx/dt = v = gt We can find the acceleration by taking the derivative again: dv/dt = a = g (a) create a function called free fall with a single input vector t that returns values for distance x, velocity v, and acceleration a. (b) Test your function with a time vector that ranges from 0 to 20 seconds. Display x, v, and a in table with column headingsExplanation / Answer
You need to run driver.m file only
driver.m
free_fall([0,1,4,8,12,16,20])
free_fall.m
function [x,v,a] = free_fall(t)
x = ones(1,size(t,2));
v = ones(1,size(t,2));
a = ones(1,size(t,2));
x = 1/2*9.8*t.^2;
v = 9.8*t;
a = 9.8*a;
fprintf(' Time x V a ');
table = [t',x',v',a'];
table
end
b) Table: