totally incorrect calculation of matlab

조회 수: 2 (최근 30일)
Jaein
Jaein 2014년 12월 10일
답변: Jaein 2014년 12월 10일
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일
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일
Thank uuuuuu

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by