Question: using matlab 2. (10 points) Create the following variables in your script: m = 8 (mass of projectile in kg), 9 =9.8 (the gravitional constant),
2. (10 points) Create the following variables in your script: m = 8 (mass of projectile in kg), 9 =9.8 (the gravitional constant), 7 = 2 (the coefficient of friction) to = 0 (the initial timing). ty = 150 (the initial velocity), yo = 10 (the initial height: ylto)). 0 =/3 (the angle of launch), Do = 0 (the initial distance: ()). 3. (10 points) The height function of a projectile is given by 1 muo sin() gm? vo) gm + y Create an anonymous function y in your script representing the height function above 4. (10 points) Create an array, t, of 100 evenly spaced points in the interval (0,25) and generate a plot of the array t versus the array created by evaluating the anonymous function y at those points. (You do not need to save and upload the image separately.) 5. (10 points) Use a root finding algorithm to compute the hang time of a projectile launched with the above parameters to a tolerance of 10-6. Report your answer in the third text box of the exam. 6. (10 points) Create an anonymous function x in your script representing the horizontal) distance traveled by a projectile: (remember that e' is computed exp(t) in Matlab) m vo cos(C) (1-e31-o)) + to 7. (10 points) Have your script display to the screen the horizontal) distance your pro- jectile traveled when it landed and record it in the fourth text box of the exam: (If you were not able to solve problem 5, display the horizontal distance the projectile traveled in 16 seconds) Bonus (20 points) Compute the array p of all prime numbers less than 105, then set 1 = the elementwise product of p and cos(p), and y=the elementwise product of p and sin(p). Create a dot plot of a versus y in a color of your choosing with equal axis scaling. Save
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
