Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Do the following tasks on Matlab Common physics equations determine the x and y coordinates of a projectile at any fime, given the object's initial

Do the following tasks on Matlab image text in transcribed
Common physics equations determine the x and y coordinates of a projectile at any fime, given the object's initial position (x0,y0) and velocity, v0, and launch angle, a. The position (x,y) of the projectile at time, t,is given by x(t)=x0+v0tcos0andy(t)=y0+v0tsin0+0.5gt2,respectively. with the launch angle given in radians and time given in seconds. Assume x0=0m,y0=0m, and v0 is 12.5m/s and note that the acceleration due to gravity (g) equals 9.81m/s2. You can also assume that nothing will interfere with the motion of the projectile. a. Ask the user to input the launch angle in radians. Use an explanatory prompt and assign the value of the launch angle to a variable named thetao. b. Assume that the user enters /4 as the launch angle, determine the values of x(t) and y(t) at time, t=0.0,0.1,0.2,0.3, and 0.4 sec using a calculator (or using MATLAE as a calculator). Round the values to 4 digits after the decimal point and list the values in a comment (or comments) in the Task 2 section of your m-file. Make sure to explain the values in the comment(s). c. Define an array named t starting with 0 sec. and ending with 5 sec. with increments of 0.1 sec. d. Preallocate memory for the x and y coordinates of position at each time point t by defining a arrays named x and y with all elements equal to zero and dimensions appropriate to contain all values of the position. e. Using a for loop, calculate the position of the projectile for initial position and velocity values, as given above, and the user-specified launch angle (not i/4). Note that you can (and should) test your script and check your position values by entering a value of /4 as the launch angle and comparing the first five values to the values you determined in part b above, but the script should be written to handle any launch angle value the user inputs. f. Create a new figure window in MATLAB using the command: figure. (See help figure) 9. Plot the y-component of position as a function of the x-component using a solid black line. h. Define an array named negative_Ind by using the find command to determine the indices of all elements of y that are less than 0 . i. Using negathe ind to identify the negative y values, plot the negative y values (as a function of x) using red circles as markers. j. Label the plot axes and title the plot appropriately

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

Students also viewed these Databases questions