% example of a 3d plot 
[x,y]=meshgrid(-2:.1:2,-2:.1:2); % this is the commmand to create a 2d mesh
clf
f=@(x,y)[x.*exp(-(x.^2+y.^2))];
z=f(x,y);
meshc(x,y,z)