Question
write the code in matlab 2. The distance a projectile travels when fired at an angle is a function of time and can be divided
write the code in matlab
2. The distance a projectile travels when fired at an angle is a function of time and can be divided into horizontal and vertical distances : Ht = t * Vo * cos() Vt = t * Vo *sin() gt^2 where: Ht is the distance traveled in the x direction Vt is the distance traveled in the y direction Vo is the initial velocity g is the acceleration due to gravity, 9.8m/s2 t is the time
a. For the projectile just described and fired at an initial velocity of 100 m/s and a launch angle of /4 (45o), find the distance traveled both horizontally and vertically ( in the x and y directions ) for times from 0 to 20 seconds. Graph horizontal distance versus time on one plot, and in a new figure window plot vertical distance versus time (time on x axis). Dont forget the title and the axis labels.
b. In a new figure window, plot horizontal distance on the x-axis and vertical distance on the y-axis.
c. Calculate new vectors for the vertical (v1, v2, v3 ) and horizontal (h1 ,h2, h3) distance traveled, assuming launch angles of /3, /5, /7. In a new figure window, graph horizontal distance on the x-axis and vertical distance on the y-axis, for all three cases. Make one line solid, one dashed and one dotted. Add a legend to identify which line is which.
d. In parts a through c, you created four plots, each in its own figure. Combine these into one figure using the subplot functon of MATLAB. Do not place all of the plots on the same graph, but do place all four plots in the same figure window.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started