MATLAB: How can i plot this 3D function

3d plotsMATLABplot

Hi, im trying to plot
f(x,y)= e^(x-y) +x^2 +y^2
but in every way i try to plot it it returns the wrong graph (it should be a paraboloid). This is the code im using:
[X,Y]= meshgrid(-10:10);
Z= exp(X-Y) + X.^2 + Y.^2;
surf(X,Y,Z)
Thank you for your help!

Best Answer

Paraboloid is Z = X.^2 + Y.^2;
[X,Y]= meshgrid(-10:10);
Z = X.^2 + Y.^2;
surf(X,Y,Z)
Due to exp() term in your equation, you won't necessarily get a paraboloid.