필터 지우기
필터 지우기

Arrow of a vector ( r, theta) from a point (x,y).

조회 수: 19 (최근 30일)
Bipul Biswas
Bipul Biswas 2021년 9월 9일
댓글: Star Strider 2021년 9월 9일
Hello,
I need to show a arrow of a vector (r, theta) form a point (x,y). Is there any function to do that?
Thanks for help.

채택된 답변

Star Strider
Star Strider 2021년 9월 9일
One approach (using the quiver function) —
x = rand
x = 0.3732
y = rand
y = 0.5120
r = rand
r = 0.9137
theta = 30; % Angle In Degrees
figure
quiver(x, y, r*cos(deg2rad(theta)), r*sin(deg2rad(theta)))
axis([0 2 0 2])
grid
Experiment to get different results.
.
  댓글 수: 2
Bipul Biswas
Bipul Biswas 2021년 9월 9일
Thanks for the response. This works.
Star Strider
Star Strider 2021년 9월 9일
As always, my pleasure!
.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

the cyclist
the cyclist 2021년 9월 9일
You can make an arrow on a plot using the annotation function, or you may want to use a quiver plot if you want the arrow to come from the data itself.

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by