You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
fzero help
2 views (last 30 days)
Show older comments
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
Walter Roberson
on 24 Feb 2011
Maybe it just doesn't like buxZED... won't let me submit an answer to this one.
Walter Roberson
on 24 Feb 2011
root = fzero(y,[eps, realmax])
Paulo Silva
on 24 Feb 2011
Hey Walter, answers stop working for me too :(
We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it shortly.
Walter Roberson
on 24 Feb 2011
Ummm, make it fzero(y,[eps,sqrt(realmax)/G]
Using fzero(y,eps,realmax) would cause realmax to be interpreted as an Option, and then it would use eps as the starting guess, not constrained from going backwards.
Walter Roberson
on 24 Feb 2011
No, there is no way to force fzero to go to the next positive root. You can only exclude the area you already searched from the area fzero is to search next.
Walter Roberson
on 24 Feb 2011
~ is logical negation. It is true if and only if the thing being tested is exactly 0.
buxZED
on 24 Feb 2011
y=@(T) I*T*sind(A)-(0.5*G*(T^2));
%root = fzero(y, eps, realmax)
rt = 0;
d = .1;
cnt = 1;
while ~rt
rt = fzero(y,rt+d*cnt);
cnt = cnt + 1;
end
fprintf('the root is %g\n' , rt)
gives me the root is 7.11215e-026
but its not posible as the projectile takes around 1.5sec to reach maximum hight, the root should be around 3
can you point me in the right derection?
Matt Tearle
on 25 Feb 2011
Can I suggest using an initial guess of 2*I*sind(A)/G? Just sayin'...
Accepted Answer
Honglei Chen
on 17 Sep 2012
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
Honglei Chen
on 17 Sep 2012
I'm helping cleaning up some old, unanswered questions :)
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown 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!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)