Please put both the text and image of the code in matlab. Is
there a way to make my already wrong code even better?
Assessment: 1 of 5 Tests Passed Run Pretest ? Submit * Is trajectory 1 calculation correct? (Pretest) Variable y1 must be of size [2001]. It is currently of size [1 200). Check where the variable is assigned a value. Make sure you generated the x-values using the range for this trajectory with 0 = 30° Double check formulas for typos and order of operations. Test Check whether variable yi has the correct value. * Is trajectory 2 calculation correct? Variable y2 must be of size [2001]. It is currently of size [1 200). Check where the variable is assigned a value. Make sure you generated the x-values using the range for this trajectory with 0 = 45. Double check formulas for typos and order of operations. * Is trajectory 3 calculation correct? Variable y3 must be of size [2001]. It is currently of size [1 200). Check where the variable is assigned a value. Make sure you generated the x-values using the range for this trajectory with 0 = 60° Double check formulas for typos and order of operations. Is there a single axes with all three plots present? * Does your script include the MATLAB commands necessary to generate the figure as specified? The submission must contain the following functions or keywords: grid, xlabel, ylabel, title, legend Be sure to include all of the elements of a properly-labeled graph. See the documentation for more information on formatting and annotating plots.
Projectile trajectory (plot of multiple data series) My Solutions y yo d Consider the motion of an object modeled with ideal projectile motion (neglecting air resistance). The trajectory of the object can be derived from basic physics and is given by the formula: x'g y = x tano + yo 2 (vocos 02 where y is the height, x is the horizontal distance in meters, 0 is the initial angle, g is the acceleration due to gravity (8 = 9.81m/s2), vo is the initial velocity in m/s, and yo is the initial height in meters. The range, d, of the projectile is the horizontal distance it travels and can be determined using the formula: Vo cose d= (vo sin 0 + V (vo sin 02 +2gyo) 8 Write a script to calculate the following three trajectories: • Trajectory1: 0, = 30°, Vo = 25 m/s, yo = 3.5 m • Trajectory2: 02 = 45°, Vo = 25 m/s, yo = 3.5 m • Trajectory3: 03 = 60°, Vo = 25 m/s, yo = 3.5 m For each value of , generate a column vector of 200 evenly-spaced x values starting at 0 and ending at the range d. Compute the associated column vectors of y values and assign the results to the variables named y1, y2, and y3 for 0, 0, and Oz respectively. Use the plot command to generate a figure with a plot of all three trajectories on a single set of axes. Use MATLAB commands to add an appropriate title, axis labels, grid and legend to the figure. Ac
Script Save C Reset MATLAB Documentation 1 d=[60.6865,67.6368,57.1266] 2 g=9.81 3 ve-25 4 ye-3.5 5 x1=linspace (60.6865, 0,280) 6 x2=linspace(67.0368,0, 200) 7 x3=linspace(57.1266,0,200) 8 y1=(x1.*tand(30))-0.5*((x1.42.*g)/(cosd(30)^2)+y) 9 plot(x1, y1) 10 hold on 11 y2=(x2.*tand(45)) -0.5*((x2.42.*g)/(cosd (45)^2)+y) 12 plot(x2,y2) 13 y3=(x3.*tand(60))-0.5*((x3.^2.*g)/(cosd(60)^2)+y@) 14 plot(x3,73) Run Script ?
Please put both the text and image of the code in matlab. Is there a way to make my already wrong code even better?
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am