HELP: MATLAB program that computes the time t
Show older comments
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
John D'Errico
on 7 Oct 2019
Edited: Walter Roberson
on 7 Oct 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?
Answers (0)
Categories
Find more on Object Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!