use calculated coords for textarrow

조회 수: 2 (최근 30일)
jake harris
jake harris 2018년 12월 9일
답변: KSSV 2018년 12월 10일
Hi guys, im trying to add a text arrow to a graph. It is a projectile motion curve so has a maximum point. This point is calculated using formulas and the variables given by the user. The coordinates of the maximum point in my code is (Sx_max, S_y). How do I plot a textarrow pointing to this with a label of the time taken num2str(T_up). Ive only been able to find examples with excat points, but my situation has a point that changes according to the values entered.
Thanks for the help

답변 (1개)

KSSV
KSSV 2018년 12월 10일
Read about quiver
n = 10 ;
x = 1:n ;
y = rand(1,n) ;
[val,idx] = max(y) ;
figure
hold on
plot(x,y)
quiver(idx,val,0,1)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by