Clear Filters
Clear Filters

write a function about 'h=vo*t-(1/2)*g*t.^2'

1 view (last 30 days)
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!!

Accepted Answer

Shunchao Wu
Shunchao Wu on 15 Nov 2011
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.

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!