Question: Can someone write the matlab code for the projectile_xy 1 of 2 MATLAB 4. Loops and Arrays There are two (2) problems to solve. Problem

 Can someone write the matlab code for the projectile_xy 1 ofCan someone write the matlab code for the projectile_xy

1 of 2 MATLAB 4. Loops and Arrays There are two (2) problems to solve. Problem 1. Greetings from Physics 218 Projectile Motion Projectile Motion (no air drag). Acceleration and Velocity e A projectile is a body that is given an initial velocty and then folows a path determined by force of gravity and air resistance. Examples: a kcked soccer bal, a bulet shot from a gun, a faling raindrop, a thrown snowbal If air resistance is negligible, a projectie moves at constant speed in horizontal direction and has constant vertical acpeleration due to gravity %, = v, cos@ v."v,sind Projectile Motion without air drag: Position of the Projectile The parameters have the following meaning . g the gravitational acceleration; we assume 9.81m's (define as a constant) . 8: the angle at which the projectile is launched (degrees) . vc the speed at which the projectile is launched (m/s) xs: the "itial distance fron a reference point. Assume that yc the initial height of the projectile. Assume that -0 Your task: Write a script (projectile_xy)which plots the trajectory of a projectile. The script should perform the following steps: 1. Ask the user to input two arguments: angle at which projectile was launched: note that the user prefers to input the angle in degrees speed v at which projectile was launched (this is v o 2. Check whether launch angle and launch speed are positive real numbers. Display error message and abort if not. 3. Starting with time r-0, and incrementing it by I s each time, repeatiedily compute the coordinates (y)of the projectile (note that the launch location has the coordinates (o,0) Collect values in one-dimensional arraysX and Y 4. Stop when the altitude becomes negative. 5. Plot the curve of the values in Y'vs X. Use MATLAB's function plot (type help plot, read) plot (X, Y)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!