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

4 Ansichten (letzte 30 Tage)
[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)

Akzeptierte Antwort

KSSV
KSSV am 23 Mai 2022
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 Kommentar
金麟 陈
金麟 陈 am 23 Mai 2022
Bearbeitet: KSSV am 23 Mai 2022
[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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Contour Plots finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by