HELP: MATLAB program that computes the time t

Im trying to write a matlab program that computes the the time t required to reach a specfic height h. For a given value of v. The inputs should be h,v, and g. h= 100 meters, v= 50m/s and g= 9.81m/s^2
original function
h=v*t-1/2*g*t^2
this is what i have
function t = time(v,h,g)
h=(v*t-(1/2)g*t*^2)

2 comentarios

John D'Errico
John D'Errico el 7 de Oct. de 2019
Editada: Walter Roberson el 7 de Oct. de 2019
Sigh. I'm sure this is like the third time I've seen this question.
Hint: What does the function roots give you? (Essentially, is that not a cubic polynomial?)
Or, could you use fzero?

Iniciar sesión para comentar.

Respuestas (0)

Preguntada:

el 7 de Oct. de 2019

Comentada:

el 7 de Oct. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by