How to incorporate positive and negative theta while plotting graph for Range vs theta in projectile motion
3 views (last 30 days)
Show older comments
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]
0 Comments
Accepted Answer
Image Analyst
on 7 Sep 2017
linspace can take negative values, you know.
My projectile demo is attached.
6 Comments
Steven Lord
on 7 Sep 2017
No, in that context 'b*-' is a line specification. Specifically it tells plot to plot a blue (b) solid line (-) with asterisks (*) as markers.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!