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.

 採用された回答

Mischa Kim
Mischa Kim 2014 年 12 月 10 日
編集済み: Mischa Kim 2014 年 12 月 10 日

0 投票

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

その他の回答 (1 件)

Jaein
Jaein 2014 年 12 月 10 日

0 投票

Thank uuuuuu

カテゴリ

ヘルプ センター および File ExchangeVector Fields についてさらに検索

製品

質問済み:

2014 年 12 月 10 日

回答済み:

2014 年 12 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by