How to label the farthest x point
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
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')
.
0 件のコメント
参考
カテゴリ
Help Center および File 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!