2017-09-14 82 views

回答

0

最困難的部分是將極座標轉換爲歐幾里德座標:

[x,y] = meshgrid(-5:1:5,-5:1:5); 

r = sqrt(x.^2 + y.^2); % r in function of (x, y) 
theta = atan2(y, x); % theta in function of (x, y) 

u = r.*cos(theta); % x component of the vector field 
v = r.*sin(theta); % y component of the vector field 

quiver(x, y, u, v) 

enter image description here