How to label the farthest x point

조회 수: 3 (최근 30일)
NEIL Alfred
NEIL Alfred 2022년 1월 25일
답변: Star Strider 2022년 1월 25일
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.

답변 (1개)

Star Strider
Star Strider 2022년 1월 25일
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')
.

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by