Question: Help me code in MATLAB, thank you! [25 points] The following diagram shows how we can calculate the position of the particle launched by an
Help me code in MATLAB, thank you!
[25 points] The following diagram shows how we can calculate the position of the particle launched by an initial velocity of vo and a launch angle of e. y * ignore drag x(t) = v, cos(O) 1 y(t, y(t) where v, = launch speed(m/s) O=launch angle(deg) x(t) g=gravitational acc (9.8m/s) particle Plot particle positions from 0 to 1 sec with a time increment of 0.05 for the launch angles of 40 and 60 when vois 10m/sec following the following steps. (1) Define 21x2 mesh grid matrices TH and T using a launch angle vector th=[40 60] and time vector t=0:0.05:1 for an initial launch speed v_o=10. Display matrices TH and T noting that each column is associated with two launch angles of 40 and 60. (2) Calculate x and y position matrices of a particle and assign them to a vector X and Y. No need display them. X=v_0*cos(TH). *T; Y=v_@*sind(TH). *T-1/2*g*T.^2; (3) Plot the positions of a particle with two launch angles with the following plot properties: Markers shown in the plot can be created with 'o' in plot function with 'markersize of 10. Insert a title of "Ball trajectory for different launch angles" and labels for x and y axes as 'x (m)' and 'Y (m)'. Insert the legend of '\theta=40' and '\theta=60'. Note that you can display Greek letters using Grid is on
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
