現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
fzero help
2 ビュー (過去 30 日間)
古いコメントを表示
buxZED
2011 年 2 月 24 日
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 件のコメント
Walter Roberson
2011 年 2 月 24 日
Maybe it just doesn't like buxZED... won't let me submit an answer to this one.
Paulo Silva
2011 年 2 月 24 日
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.
buxZED
2011 年 2 月 24 日
??? Error using ==> fzero at 260
Function values at interval endpoints must be finite and real.
Error in ==> p34 at 26
root = fzero(y,[eps, realmax])
>>
buxZED
2011 年 2 月 24 日
@matt Fig
that was my inicial thought
but we are not alowed to use neumerical methods or guess work
Walter Roberson
2011 年 2 月 24 日
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
2011 年 2 月 24 日
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.
buxZED
2011 年 2 月 24 日
it works
but i want to understand what while ~rt means (what dose ~ say)
dose this stop counting as it finds the first root after zero?
Walter Roberson
2011 年 2 月 24 日
~ is logical negation. It is true if and only if the thing being tested is exactly 0.
buxZED
2011 年 2 月 24 日
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?
buxZED
2011 年 2 月 24 日
is there a way to systematicaly increase the T value till Y become zero and get that value?
Matt Fig
2011 年 2 月 24 日
Change from:
while ~rt
to:
while rt<.1
or similar. It might help if you actually gave us some values for I, A and G.
buxZED
2011 年 2 月 24 日
it worked Matt
thank you so much
and also ~ would allow me to use matlab in many new ways
thank you again :D
Matt Fig
2011 年 2 月 25 日
Come on now, Matt! Where is the fun of solving the equation with your brain instead of making MATLAB do it?
採用された回答
Honglei Chen
2012 年 9 月 17 日
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 件のコメント
Matt Fig
2012 年 9 月 17 日
Digging deep, Honglei! How did you come across this one from over a year ago?
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)