Invalid use of operator while trying to plot surface
이전 댓글 표시
I am a total rookie when it comes to MatLab so I got stuck right away when trying to plot a surface. I get the "invalid use of operator" error code when trying to write the expression for Z, which is supposed to look something like this: z=(4x^2+8xy-2y^2)e^{-(x^2+2y^2)}. MatLab seems to point out that the minus sign in front of the 2 is the issue. How should I code the expression?
>> x=linspace(-3,3);
y=linspace(-2,2);
[X,Y]=meshgrid(x,y);
Z=(4*X.^2+8*X.*Y.-2*Y.^2)*exp^-(X.^2+2Y.^2);
↑
Invalid use of operator.
Thanks in advance!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!