the function is f(x,y)= 10*x^2*y -5*x^2- 4y^2 -x^4 -2y^4
so when i add "." to the y behind x^2, matlab didn't like it one bit. No matter what i tried it seems to only show a meshgrid plain at best
pic is what i expects it to looks like. And most matlab examples aren't steep like this, so im getting out of ideas too

 채택된 답변

the cyclist
the cyclist 2022년 8월 10일
This is what I get from your equation:
xv = -5 : 0.01 : 5;
yv = -5 : 0.01 : 5;
[x,y] = meshgrid(xv,yv);
f = 10*x.^2.*y - 5*x.^2 - 4*y.^2 - x.^4 - 2*y.^4;
figure
mesh(x,y,f)
Are you absolutely sure you keyed the same equation into the two different software systems? (I can't see the full equation in your image.)

댓글 수: 3

yep, im sure. And i did almost the same code like you, got the same graph too, strangely the web draws it differenly. here is mine code and pic
[x,y] = meshgrid(-10:0.5:10);
z = 10*x.^2*y - 5*x.^2 - 4*y.^2 - x.^4 - 2*y.^4;
mesh(z)
the cyclist
the cyclist 2022년 8월 10일
편집: the cyclist 2022년 8월 10일
Your formula is not the same as mine. You have
10*x.^2*y
instead of
10*x.^2.*y
That's a matrix multiplication instead of an element-by-element multiplication. That's what's causing the difference, not the web vs. local computing.
ok, now i see it. Thanks for the help

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

태그

질문:

2022년 8월 10일

댓글:

2022년 8월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by