I am trying to create a 3D plot of f(x,y)=xsin(xy)exp(-(x+y)/10) uisng the surf
command. My code is below:
x=linspace(-5,5,400);
y=linspace(-3,3,400);
[X,Y]=meshgrid(x,y);
Z=x.*sin(x.*y).*exp(-(x+y)/10);
surf(X,Y,Z);
shading interp;
The error Z must be a matrix, not a scalar or vector
is being displayed. What have I done wrong?