how to use quiver3 plot vectors at zero points(i want to set the start point of the vectors all at zero points)

조회 수: 4 (최근 30일)
[x,y,z]=meshgrid(-3:1:3,-3:1:3,-3:1:3);
dx=x;
dy=y;
dz=z;
r=(dx.^2+dy.^2+dz.^2).^0.5;
u=dx./r;
v=dy./r;
w=dz./r;
figure
quiver3(x,y,z,u,v,w)

채택된 답변

KSSV
KSSV 2022년 5월 23일
Simple, make x,y,z matrices as zeros matrix.
[x,y,z]=meshgrid(-3:1:3,-3:1:3,-3:1:3);
dx=x;
dy=y;
dz=z;
r=(dx.^2+dy.^2+dz.^2).^0.5;
u=dx./r;
v=dy./r;
w=dz./r;
x = 0*x ;
y = 0*y ;
z = 0*z ;
figure
quiver3(x,y,z,u,v,w)
  댓글 수: 1
金麟 陈
金麟 陈 2022년 5월 23일
편집: KSSV 2022년 5월 23일
[x,y,z]=meshgrid(-3:1:3,-3:1:3,-3:1:3);
dx=x;
dy=y;
dz=z;
r=(dx.^2+dy.^2+dz.^2).^0.5;
u=dx./r;
v=dy./r;
w=dz./r;
figure
quiver3(x-x,y-y,z-z,u,v,w)% i achieve this operation in another way.

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

추가 답변 (0개)

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by