Can not get vector field

5 次查看(过去 30 天)
Marcin R
Marcin R 2021-12-12
评论: Marcin R 2021-12-13
Hello,
I try to plot vector field given by the formula:
in order to do so I defined:
y = 0:0.1:100;
x = -y;
and finaly try to plot it by quiver(x,y)
Unfortunately instead of vector filed around unit circle I get
Also, I feel like I don't get this from math perspective as well. The author says that this formula should give circular vector field which should be intuitively visibile - how, I don't see it right away.
Thanks for the clarification.

采纳的回答

KSSV
KSSV 2021-12-12
y = 0:0.1:100;
x = -y;
[X,Y] = meshgrid(x,y) ;
quiver(X,Y)
  3 个评论
KSSV
KSSV 2021-12-13
r = 1 ; % Radius of circle
C = [0 0 ] ; % Origin of circle
th = linspace(0,2*pi,100) ; %
x = C(1) + r*cos(th) ;
y = C(2) + r*sin(th) ;
plot(x,y,'b')
hold on
idx = 1:10:100 ;
quiver(x(idx),y(idx),-y(idx),x(idx))
Marcin R
Marcin R 2021-12-13
Thanks, this is exactly what I was looking for.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surrogate Optimization 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by