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 个评论

Probably because you are using matrix operation ( like ^ * and / ) instead of the element-wise operations ( .^ .* and ./)
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?
No error message, theta and v are constant. I need the graph to show a curve instead of a point.
So it is plotting, but just a point.
You cant get a curve if you dont have a variable in your equation.
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 个评论

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.
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.
oops ! didn’t read the comment given by the user thank you both.
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.
@ImageAnalyst, they're easiest to find in the McMurdo Dry Valleys, where there's very little weathering. Footprints can stick around for decades there.
Are they sitting on the snow, or gravel? How do they find them? By sight (sitting on snow) or my metal detectors?

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Oceanography and Hydrology 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by