필터 지우기
필터 지우기

Arrows of the same length in a quiver plot

조회 수: 80 (최근 30일)
Kourosh
Kourosh 2014년 8월 11일
댓글: David Martin 2023년 8월 18일
Hello,
I know that vectors can be superimposed over a curve using quiver (dx, dy, du, dw, scale). I am only interested in keeping the angle and prefer to have vectors with the same length. I am wondering how I can have vectors with the same length. I have used (dx, dw, du, dw, 1/(du^2+dw^2)) to create the equal length but the length of vectors are still different!
Cheers,
Cyrus

채택된 답변

Michael Haderlein
Michael Haderlein 2014년 8월 11일
Scale is not the right parameter for your purpose. You need to normalize the velocity:
un=du./sqrt(du.^2+dw.^2);
wn=dv./sqrt(du.^2+dw.^2);
quiver(dx,dy,un,wn)
Best regards,
Michael
  댓글 수: 2
Kourosh
Kourosh 2014년 8월 12일
Great, thank you.
Regards,
Cyrus
David Martin
David Martin 2023년 8월 18일
Why doesn't this work for me? I have the following code and the arrows come out with different lengths.
t = 0:0.5:5;
v = -5:0.5:5;
[T,V] = meshgrid(t,v);
dT = 0.05 + 0.0*T;
dV = (2+V).*dT;
dR = sqrt(dT.^2 + dV.^2);
dT = dT ./ dR;
dV = dV ./ dR;
quiver(T,V,dT,dV,'Linewidth',2);
Any help would be appreciated.

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

추가 답변 (0개)

카테고리

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