Help with the following error with quiver

2 ビュー (過去 30 日間)
Amy Topaz
Amy Topaz 2022 年 3 月 24 日
編集済み: Rik 2022 年 5 月 24 日
I am getting the above error using the function quiver for vector field
x = -4e-7:0.1e-12:4e-7;
y = -4e-7:0.1e-12:4e-7;
[X,Y] = meshgrid(x,y);
HX = (atan(((g/2 + X)./Y);
HY1 = (cos((g/2 + X).^2 + (Y).^2/(g/2 - X).^2 + (Y).^2));
H = sqrt(HY1.^2 + HX.^2);
quiver(H,X,Y);
  5 件のコメント
Rik
Rik 2022 年 5 月 24 日
Editing away your question is very rude, please don't do it again.

サインインしてコメントする。

採用された回答

Sam Chak
Sam Chak 2022 年 3 月 24 日
編集済み: Sam Chak 2022 年 3 月 26 日
If g is assumed as the gravity, then the "Region of Repulsion" is found here. Solving the simultaneous equations and give two saddle points somewhere around and region. Check it out.
[X, Y] = meshgrid(-7:4/14:-3, -2:4/14:2);
g = 10;
U = (1/pi)*(atan(((g/2 + X)./Y) + atan((g/2 - X)./Y)));
V = (-1/2*pi)*(log((g/2 + X).^2 + (Y).^2./(g/2 - X).^2 + (Y).^2));
quiver(X, Y, U, V, 1.5)
axis square
axis([-7.5 -2.5 -2.5 2.5])
  1 件のコメント
Sam Chak
Sam Chak 2022 年 3 月 24 日
Are you looking for 3-D vector field like this?
[X, Y, Z] = meshgrid(-7:4/14:-3, -2:4/14:2, 0:4/14:4);
g = 10;
U = (1/pi)*(atan(((g/2 + X)./Y) + atan((g/2 - X)./Y)));
V = (-1/2*pi)*(log((g/2 + X).^2 + (Y).^2./(g/2 - X).^2 + (Y).^2));
H = sqrt(U.^2 + V.^2);
h = quiver3(X, Y, Z, U, V, H);
set(h, 'maxheadsize', 1.5);

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2022 年 3 月 24 日
quiver has a few calling sequences:
  • quiver(x, y, u, v)
  • quiver(u, v)
  • either of those followed by a scale factor
  • any of the above proceeded by an axes handle
You are using three parameters, so you are either using axes, u, v or else u, v, scale. But the first parameter is not an axes so you are using u,v, scale
Did you possibly intend to use quiver3?

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by