Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

fzero help

Asked by buxZED on 24 Feb 2011
y=@(T) I*T*sind(A)-(0.5*G*(T^2));
root = fzero(y, 0)

abouve eqation is for a projectile that projected at an angle (gose in a kind of ar half oval shape)

want to find the time it hist ground but fzero only gives me the biginning which is 0

23 Comments

buxZED on 24 Feb 2011

it worked Matt
thank you so much
and also ~ would allow me to use matlab in many new ways
thank you again :D

Matt Tearle on 25 Feb 2011

Can I suggest using an initial guess of 2*I*sind(A)/G? Just sayin'...

Matt Fig on 25 Feb 2011

Come on now, Matt! Where is the fun of solving the equation with your brain instead of making MATLAB do it?

buxZED

Products

No products are associated with this question.

1 Answer

Answer by Honglei Chen on 17 Sep 2012
Accepted answer

The anwser is in the comments above

From Matt Fig

rt = 0; 
d = .1; 
cnt = 1; 
while rt<.1 
rt = fzero(y,rt+d*cnt); 
cnt = cnt + 1; 
end

2 Comments

Matt Fig on 17 Sep 2012

Digging deep, Honglei! How did you come across this one from over a year ago?

Honglei Chen on 17 Sep 2012

I'm helping cleaning up some old, unanswered questions :)

Honglei Chen

Contact us