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

John D'Errico
John D'Errico 2019년 10월 7일
편집: Walter Roberson 2019년 10월 7일
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?

댓글을 달려면 로그인하십시오.

답변 (0개)

질문:

2019년 10월 7일

댓글:

2019년 10월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by