write a function about 'h=vo*t-(1/2)*g*t.^2'
조회 수: 3 (최근 30일)
이전 댓글 표시
question about matlab I want to write a function about 'h=vo*t-(1/2)*g*t.^2'. h=100; vo=5:5:50; In order to get each 't' , how can I write a function such as 'fhandle=@(arglist) expression'? Do I have to put 't' at the left side of the equal sign? Also,I have to draw a 'vo-t' figure. Thanks for help!!
댓글 수: 0
채택된 답변
Shunchao Wu
2011년 11월 15일
Solve it directly,
t=(vo+-sqrt(vo^2-2*g*h))/g
if vo^2>2*g*h, there are two solutions, if vo^2=2*g*h, one solutiuo if vo^2<2*g*h, no solution.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!