% create the mesh [x,y]=meshgrid(linspace(-5,5,50)); % calculate z-values z=9-x.^2+x.*y-2*y.^2; % draw graph mesh(x,y,z)