Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using matlab, write the code for the following problem: The height and speed of a projectile (such as a thrown ball) launched with a speed
Using matlab, write the code for the following problem:
The height and speed of a projectile (such as a thrown ball) launched with a speed of v_0 at an angle alpha to the horizontal are given by h(t) = v__0 t sin alpha - 1/2 gt^2 and v(t) = square v^2_0 - 2v0 gt sin alpha + g^2 t^2 where g is the gravitational acceleration. The projectile will strike the ground when h (t) = 0, which gives the time to hit t__hit = 2 (v_0/g) sin alpha. Use the switch structure to write a MATLAB program to compute (i) the maximum height reached by the projectile, (ii) the total horizontal distance traveled, and (iii) the time to hit. The program should accept as input the user's choice of which quantity to compute and the values of v0, alpha g. Test the case where v_0 = 40 (m/s), alpha = 30 degree, and g = 9.81 (m/s^2) and show the corresponding analysis results
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started