Question: matlab Write a MATLAB function called trajectory.m that computes the trajectory of a projectile launched at a specified angle theta and initial velocity v. The

matlab
Write a MATLAB function called trajectory.m that computes the trajectory of a projectile launched at a specified angle theta and initial velocity v. The function should return the horizontal and vertical position in feet of the projectile in question and the time array corresponding to those coordinates in seconds Function Name: trajectory.m Input Arguments: Angle in Radians (theta) Velocity in ft/sec (v) Optional Input Argument: Number of Points (default value is 100) Output Arguments: Horizontal motion trajectory in feet (x) Vertical motion trajectory in feet (v) Time array corresponding to x and y in seconds (t) . Velocity components can be found using trigonometric identities: Vx v"cos(theta) . Horizontal flight is as provided below . Here, t ranges from 0 to time of flight (tf) where tf is computed using the below formula where g-32 ft/sec 2. Make sure t' has linearly spaced values between 0 to tf based on the Number of points entered by the user (if not a defauit value of 100) . Vertical fight is provided below Now, write a script file 'run trajectory.m' to call the trajectory( function with the following parameters theta as /4 and velocity (1 as 90 ft/sec and get output arguments as x , y and t. Make sure to clear all variables in workspace before calling the function, Visualize the horizontal and vertical motion trajectony and label the axis. Your plot should loak something like Figure 1 60 50 S 40 30 10 50 100 150 200 250 Horizontal Flight in ft Figure 1: Trajectory Motion with theta /4 and Velocity 90 ft/sec
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
