totally incorrect calculation of matlab

I used quiver to plot a vector field. the code was :
[x,y]=meshgrid(0:1:20);
quiver(x,y,x^3-3*x*y,y^3-3*x^2*y)
However the results were completely different from expected, showing downward arrow at x=0, which should have been upward. Other arrows didn't match either.

 Akzeptierte Antwort

Mischa Kim
Mischa Kim am 10 Dez. 2014
Bearbeitet: Mischa Kim am 10 Dez. 2014

0 Stimmen

Jaein, use instead
[x,y] = meshgrid(0:1:20);
quiver(x,y,x.^3-3*x.*y,y.^3-3*x.^2.*y) % note the dot-notation

Weitere Antworten (1)

Kategorien

Mehr zu Vector Fields finden Sie in Hilfe-Center und File Exchange

Produkte

Gefragt:

am 10 Dez. 2014

Beantwortet:

am 10 Dez. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by