How to label the farthest x point
3 views (last 30 days)
Show older comments
v0=75;%initial velocity of 75m/s
g=9.81;%force of gravity 9.81 m/s^2
theta=[0:(pi/100):(pi/2)]; %values between constraints
temp1=sin(2*theta);%formula for Range given
temp2=(v0^2)/g;
Range=temp2.*temp1;
plot(Range,theta)
title('Maximum Projectile Range');
xlabel('Range(m)');
ylabel('Theta(angle)');
grid on;
This is the code and i need to label the maxiumum x value without using ginput.
0 Comments
Answers (1)
Star Strider
on 25 Jan 2022
Consider perhaps ...
v0=75;%initial velocity of 75m/s
g=9.81;%force of gravity 9.81 m/s^2
theta=[0:(pi/100):(pi/2)]; %values between constraints
temp1=sin(2*theta);%formula for Range given
temp2=(v0^2)/g;
Range=temp2.*temp1;
plot(Range,theta)
title('Maximum Projectile Range');
xlabel('Range(m)');
ylabel('Theta(angle)');
grid on;
[Rmax,idx] = max(Range);
text(Rmax, theta(idx), sprintf('Farthest ‘x’ Point \\rightarrow '), 'Horiz','right', 'Vert','middle')
.
0 Comments
See Also
Categories
Find more on Specifying Target for Graphics Output in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!