Projectile motion plot angle not working on graph

g = 9.8;
x0 = 0;
t = 0:.01:15;
Vo = 'What is the Initial Velocity? ';
Vo = input(Vo);
Theta = 'What is the Angle? ';
Theta = input(Theta);
y0 = 'What is the Initial Y position? ';
y0 = input(y0);
x = x0+Vo*cosd(Theta)*t;
y = y0+Vo*sind(Theta)*t-(g*t.^2)/2;
plot (x,y, 'Linewidth', 3)
I am seeking help once again since I am still confused. My graph is flat, no matter what angle I enter. My graph also starts at a negative number, and I want it to start at 0, but dont know how. Does anyone know how to fix this?

回答 (2 件)

Star Strider
Star Strider 2019 年 12 月 16 日

0 投票

Your code works when I run it with:
Vo = 100;
Theta = 45;
y0 = 0;
Image Analyst
Image Analyst 2019 年 12 月 16 日

0 投票

For what it's worth, I'm attaching my projectile demo where it computes and plots practically everything you could ever want to know about a projectile.

カテゴリ

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

製品

質問済み:

2019 年 12 月 16 日

回答済み:

2019 年 12 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by