how to get rid of imaginary numbers, after a root.
64 ビュー (過去 30 日間)
古いコメントを表示
oskar
2013 年 10 月 25 日
コメント済み: Kumaresh Kumaresh
2022 年 6 月 14 日
hi, i´m a beginner in matlab and i have been making a tracejtory with a basketball. my problem now is with the time.
This is a part of my script. My speed and angle are two vectors, because of the vectors sometimes the roots will be an imaginary number and (at=atand....) will get error. How do I do if i only want real numbers to go into at=atand....
time = roots([-g./2, v0y, y0-H]);
time = max(time);
at=atand((h0*cos(V))/((h0*sin(V))-(g*tid)));
thanks for your time=)
0 件のコメント
採用された回答
Muruganandham Subramanian
2013 年 10 月 25 日
time = roots([-g./2, v0y, y0-H]);
time = max(time);
time=real(time);
at=atand((h0*cos(V))/((h0*sin(V))-(g*tid)))
2 件のコメント
その他の回答 (2 件)
Simon
2013 年 10 月 25 日
Hi!
What do you expect, physically? Your trajectory is a parabola with negative prefactor in front of t^2. So, the apex is the highest point of your curve. If it is negative you won't find real roots of the polynom. Pyhsically this means you throw your ball from below the earth's surface and it is falling downwards ... ;-)
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!