Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Prepare a MatLab program (script m-file) for an algorithm to calculate the traje

ID: 3546273 • Letter: P

Question

Prepare a MatLab program (script m-file) for an algorithm to calculate the trajectory of a projectile.  The user will input the initial velocity in ft/sec^2 and the launch angle in degrees.  (initialize g to 32.1740486 and use the variable g in your equations).  Assume the projectile is launched from the ground.  


The algorithm should determine and output the time aloft and the horizontal distance to impact (use the fact that you can calculate the time and x location when the projectile hits the ground (y=0).  


The program should also produce a table of the X location and Y location of the projectile as a function of time using a user input time increment.  If the time aloft is not evenly divisible by the user input time increment, the last date point in the table will be shortly before impact.  Output all values with two places afer the decimal.  


HELP ME WRITE THE CODE FOR THIS PROBLEM!

Explanation / Answer

Hi, Your program is here: http://pastebin.com/sZg29Z65

How to run:

Save the code to a file calculateTrajectory.m in your matlab PATH and run

calculateTrajectory(300, 30)

enter the time as per your choice: e.g. 3


Please let me know if you need more help. Please dont forget to rate. Thanks