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 Comments

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?

Sign in to comment.

Answers (0)

Asked:

on 7 Oct 2019

Commented:

on 7 Oct 2019

Community Treasure Hunt

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

Start Hunting!