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 Center および File ExchangeSpecifying 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