The quiver does not draw arrows just a lot of blue, matlab

Can someone tell me what I'm doing wrong with the function of building a quiver, when I actually do not get the arrow, it just fills the empty space with a lot of blue ones. Take a look at the image below and then look at my code.

This is only part of my outline, as it strengthens the force if I try to make it larger. But my function, contours and everything else works, it's just a quiver that I'm having problems with.

Matlab plot

interval = -100:100;

[X Y] = meshgrid(interval, interval);

h = figure;
contour(X, Y, Z);

hold on;

[FX,FY] = gradient(-Z);
quiver(X, Y, FX, FY);

hold off;

If I make my matrix more sparse, for example, with an interval = linspace (-800, 1600, 1200); The result will look like this: enter image description here

EDIT: , . , . , .

script , - , .

m1 = 1;
m2 = 0.4;
r1 = [1167 0 0];
r2 = [-467 0 0];
G = 9.82;

w = sqrt( G*(m1+m2) / norm(r1-r2)^3 );

interval = linspace(-800, 1600, 1200);

% Element-wise 2-norm
ewnorm = @(x,y) ( x.^2 + y.^2 ).^(1/2);

% Element-wise cross squared
ewcross2 = @(w,x,y) w^2.*( x.*x + y.*y );

[X Y] = meshgrid(interval, interval);

Z = - G*m1 ./ ewnorm( X-r1(1), Y-r1(2) ) - G*m2 ./ ewnorm( X-r2(1), Y-r2(2) ) - 1/2*ewcross2(w,X,Y);

h = figure;
contour(Z);

daspect([1 1 1]);

saveas(h, 'star1', 'eps');

hold on;

[FX,FY] = gradient(-Z);
quiver(X, Y, FX,FY);

hold off;
+2
2

, . , . , :

interval = -100:2:100

, , , X:Y:Z. linspace:

interval = linspace(-100,100,10);

, 10x10. , , . . "" . , 0, , . quiver , quivergroup , .

, AutoScale off AutoScaleFactor:

quiver(X, Y, FX, FY, 'AutoScale', 'off');
quiver(X, Y, FX, FY, 'AutoScaleFactor', 10);

MarkerSize MaxHeadSize. quivergroup - .

+5

interval = -100:100;

[X Y] = meshgrid(interval, interval);

h = figure;
contour(X, Y, Z);

hold on;

[FX,FY] = gradient(-Z);
GM = sqrt(FX.^2 + FY.^2);
threshold = 0.1;
mask = GM > threshold;
quiver(X(mask), Y(mask), FX(mask), FY(mask));

hold off;

> 0,1;

+1

All Articles