Plot vector field expressed in polar coordinates with quiver in MATLAB -
i want plot following vector field expressed in polar coordinates:
e = r * r % (i using big r represent r^ hat).
the field should figure p3.20:
the difficult part converting polar euclidean coordinates:
[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 vector field v = r.*sin(theta); % y component of vector field quiver(x, y, u, v)
Comments
Post a Comment