How to incorporate positive and negative theta while plotting graph for Range vs theta in projectile motion

3 ビュー (過去 30 日間)
I am trying to write a code to plot a graph for Range vs theta for projectile motion and using it in LABVIEW. I don't know how to incorporate θ as positive and negative when above and below the horizontal. Below is the code I have written for LABVIEW's MATLAB script
v
g = 9.8
H
V = v.*v
G = 2.*g
theta = linspace(0,90,91)
a = 2.*theta
b = sin(a)
c = b.*b
d = V/G
e = 8.*g.*H /V
A = sqrt((sin(a)).^2+e.*(cos(theta)).^2)
R = d.*[a+A]

採用された回答

Image Analyst
Image Analyst 2017 年 9 月 7 日
linspace can take negative values, you know.
My projectile demo is attached.
  6 件のコメント
Steven Lord
Steven Lord 2017 年 9 月 7 日
No, in that context 'b*-' is a line specification. Specifically it tells plot to plot a blue (b) solid line (-) with asterisks (*) as markers.
Peter Walt
Peter Walt 2017 年 9 月 7 日
thank you very much for your effort in answering it. Got the correct one.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by