projectile motion using switch structure.

height and speed are given by the following equations:
h(t)=v0*t*sin(A)-.5*g*t^2
v(t)=sqrt(v0^2 -2*v0*g*t*sin(A)+t^2 *g^2)
the projectile will strike ground when h(t)=0 gives hit time as thit=2*(v0/g)*sin(A)
g=9.81
A is angle to the horizontal
t=time in seconds
How do i use switch structure to compute either the max height, horizontal distance or the hit time? The program needs to be able to accept as input the users choice of which quantity to compute and the values of v0, A and g.

2 comentarios

Jim Riggs
Jim Riggs el 6 de Abr. de 2019
It seems that you are asking for people to write code for you.
Why don't you give it a try, and people will help you where you get stuck.
ian flanagan
ian flanagan el 6 de Abr. de 2019
I actually got it to work. So no one needs to answer this now.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 5 de Abr. de 2019

Comentada:

el 6 de Abr. de 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by