The distance traveled by an object fired from an airplane towards the earth (ignoring air resistance) is given by the equation:
y = v0t + (1/2)at2
where v0 is the object’s initial velocity, a is the acceleration due to earth’s gravity, and t is time. Use MATLAB to calculate and plot how far an object travels for times 0-6 at intervals of 0.1 seconds if v0 = 12m/s and a = 9.81m/second2
Label the x and y axes and give the plot a title.
Code :
figure
% Creating Equally Spaced Time Values of interval 0.1
seconds
t = linspace(0,6,60);
% Declearing Initial Velocity
v0 = 12;
% Declearing Accleration Values
a = 9.81;
% Relation between Distance and Time
y = (v0.*t)+(.5.*a.*t.*t);
%Plotting
plot(t,y);
hold on
Code Screen Shot :

Output :

The distance traveled by an object fired from an airplane towards the earth (ignoring air resistance)...