Develop a complete Mathlab program that will calculate the f
Develop a complete Mathlab program that will calculate the flight of the projectile launched at a prescribed speed and launch angle. Determine the trajectory of the flight path and the horizontal distance traveled before hitting the ground. I want exact mathlab part here.
Solution
Here I am taking initial velocity as v0 and initial angle as angle0. The below is the matlab code.
x0 = 0;
y0 = 0;
v0 = 10;
angle0 = pi/3;
g = 9.81;
tmax = 2*v0*sin(angle0)/g;
t = 0:.01:tmax;
x = x0 + v0*cos(angle0)*t;
y = y0 + v0*sin(angle0)*t - g*t.^2/2;
plot(x,y);
