필터 지우기
필터 지우기

Arrow in quiver plot does not show with change of position

조회 수: 5 (최근 30일)
Abhik Saha
Abhik Saha 2022년 8월 21일
댓글: Abhik Saha 2022년 8월 21일
I have a program copy below that generate a quiver plot. For x1=0,y1=0. But if I change the value of the x1=0.25 or higher value with same spacing then it does not show all the points in the quiver plot. I am new to matlab. please help regarding this issue?
I am copying the code below
------------------------------------------------------------------------------
spacing = 0.1;
[x,y] = meshgrid(-1:spacing:1);
x1=0.25;y1=0;
Tau=1;
r=sqrt(x.^2+y.^2);
r1=sqrt(x1^2+y1^2);
A=0.5/pi;
U=-((A*Tau*(y-y1))./(abs(r-r1).^2));
V=((A*Tau*(x-x1))./(abs(r-r1).^2));
figure(1);clf;
plot(x,y,'ob')
hold on
plot(x1,y1,'or','linewidth',2)
quiver(x,y,U,V)
--------------------------------------------------------------------------------------

답변 (1개)

KSSV
KSSV 2022년 8월 21일
You may consider dividng the component of vector with the magnitude and plot.
spacing = 0.1;
[x,y] = meshgrid(-1:spacing:1);
x1=0.25;y1=0;
Tau=1;
r=sqrt(x.^2+y.^2);
r1=sqrt(x1^2+y1^2);
A=0.5/pi;
U=-((A*Tau*(y-y1))./(abs(r-r1).^2));
V=((A*Tau*(x-x1))./(abs(r-r1).^2));
W = sqrt(U.^2+V.^2) ;
figure(1);clf;
plot(x,y,'ob')
hold on
plot(x1,y1,'or','linewidth',2)
quiver(x,y,U./W,V./W)
  댓글 수: 1
Abhik Saha
Abhik Saha 2022년 8월 21일
Ok This works but for large values of x and y meaning that when it is close to plus/minus one then the height of the arrow should decrease to describe the behaviour. But this is missing here How can I generate this ?

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

카테고리

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