Why won't my graph plot

x = (v^2*sin(theta)^2)/g; % Where the projectile lands if it does not split it up
y = x*tan(theta)-(g*x^2)/(2*v^2*cos(theta)^2);% The trajectory the projectile takes.
plot(x,y)

5 件のコメント

Rik
Rik 2019 年 1 月 23 日
Probably because you are using matrix operation ( like ^ * and / ) instead of the element-wise operations ( .^ .* and ./)
Kevin Phung
Kevin Phung 2019 年 1 月 23 日
can you provide more information on the other variables? Are theta and V constant?
If so then x is a constant and so is your y value-- so plotting would just give a point.
Can you also elaborate on 'Why wont my graph plot'.
Is no figure appearing at all? Is there an error message?
Osamah Ahmed
Osamah Ahmed 2019 年 1 月 23 日
No error message, theta and v are constant. I need the graph to show a curve instead of a point.
Kevin Phung
Kevin Phung 2019 年 1 月 23 日
So it is plotting, but just a point.
You cant get a curve if you dont have a variable in your equation.
Walter Roberson
Walter Roberson 2019 年 1 月 23 日
Where is time in your equations ?

サインインしてコメントする。

回答 (2 件)

Image Analyst
Image Analyst 2019 年 1 月 25 日
編集済み: Image Analyst 2019 年 1 月 25 日

1 投票

My attached projectile program (developed by me duing my son's college physics class) plots and computes just about everything you could possibly want regarding a drag-free projectile.
0001 Screenshot.png
madhan ravi
madhan ravi 2019 年 1 月 24 日

0 投票

Put dots in front of ^ and * (element wise operation ) since x is a vector , you will get a curve.

7 件のコメント

Walter Roberson
Walter Roberson 2019 年 1 月 25 日
No they won't. They have no time component in their equations. They said that theta and v are constant; that is going to give constant x and constant y unless g is non-scalar. And if your gravity is not a constant, then you definitely need to include a time component in your equations.
Image Analyst
Image Analyst 2019 年 1 月 25 日
編集済み: Image Analyst 2019 年 1 月 25 日
Gravity is not exactly a constant (as you know). It changes with the projectile's altitude, and since the altitude changes with time of flight, the gravity changes with time, though probably negligibly.
In fact one thing people don't realize is that the gravity in the International Space Station is almost the same as on earth. You weigh more in the "weightless" environment of the ISS than on the moon! Surprising, to most people. Just calculate it using Newton's gravitational force formula and see for yourself:
F_earth = G*m1*m2/6371^2 m1 = mass of earth, m2 = mass of human
F_ISS = G*m1*m2/(6371 + 400)^2 400 is distance of ISS above earth's surface in km
ratio = 6331^2 / (6731^2) = 88.4% as much on ISS as on earth.
Just another astronomical, non-intuitive, fun fact (like meteorites being burning hot when they land, etc.)
I really admire rocket scientists (like my late father) who were able to do all those calculations, with complicating things like drag, multiple moving bodies, changing gravity, etc., with the primitive computers at the time.
madhan ravi
madhan ravi 2019 年 1 月 25 日
oops ! didn’t read the comment given by the user thank you both.
Image Analyst
Image Analyst 2019 年 1 月 25 日
Interesting. So they have all kinds of temperatures. Well there are at least enough of them falling on the Antarctic such that NASA has a team of people on snowmobiles searching the Antarctic for them. The ones they find were evidently cooled down enough by the frigid -60 degree upper atmosphere air that they land on the snow and just sit there - they don't melt through. Or at least the ones they find don't, and they find more in the Antarctic than anywhere because they're easy to see. I wonder if Answers contributor Chad Greene has personally found any of these at the Antarctic.
Chad Greene
Chad Greene 2019 年 2 月 15 日
@ImageAnalyst, they're easiest to find in the McMurdo Dry Valleys, where there's very little weathering. Footprints can stick around for decades there.
Image Analyst
Image Analyst 2019 年 2 月 16 日
Are they sitting on the snow, or gravel? How do they find them? By sight (sitting on snow) or my metal detectors?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeOceanography and Hydrology についてさらに検索

質問済み:

2019 年 1 月 23 日

コメント済み:

2019 年 2 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by