x=linspace(-1,1,40);
y=linspace(-1,1,40);
[x,y]=meshgrid(x,y);
z=x.^2+y.^2; %z=f(x,y)
meshc(x,y,z);
grid on
box on
view([130,30])
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis')
title('Mesh and contours for f(x,y)')