用surf和mesh画出z=x^2+2y^2
假设题主的画图范围是-1到1
[x,y]=meshgrid(-1:0.1:1); z = x.^2+y.^2; figure(1) surf(x,y,z); title('surf') figure(2) mesh(x,y,z); title('mesh')