绘制函数 z=(x+y)^2 的曲面图
A: x=-3:0.1:3; y=-3:0.1:3; z=(x+y)^2; surf(x,y,z)
B: x=-3:0.1:3; y=-3:0.1:3; z=(x+y).^2; surf(x,y,z)
C: x=-3:0.1:3; y=-3:0.1:3; z=(x+y).^2; meshgrid(x,y,z); surf(x,y,z)
D: x=-3:0.1:3; y=-3:0.1:3; [X,Y]=meshgrid(x,y); Z=(X+Y).^2; surf(X,Y,Z)
A: x=-3:0.1:3; y=-3:0.1:3; z=(x+y)^2; surf(x,y,z)
B: x=-3:0.1:3; y=-3:0.1:3; z=(x+y).^2; surf(x,y,z)
C: x=-3:0.1:3; y=-3:0.1:3; z=(x+y).^2; meshgrid(x,y,z); surf(x,y,z)
D: x=-3:0.1:3; y=-3:0.1:3; [X,Y]=meshgrid(x,y); Z=(X+Y).^2; surf(X,Y,Z)
举一反三
- 在使用surf绘制空间曲面时,需要先生成网格点矩阵。若绘图区域为-2<x<2,-3<y<3,曲面方程为z=3*x*y^2,下列指令正确的是( ) A: x=-2:0.5:2; y=-3:0.5:3; z=3*x.*y.^2; surf(x,y,z) B: x=-2:0.5:2; y=-3:0.5:3; [x,y]=meshgrid(x,y); z=3*x.*y.^2; surf(x,y,z) C: x=-2:0.5:2; y=-3:0.5:3; z=3*x*y^2; surf(x,y,z) D: x=-2:0.5:2; y=-3:0.5:3; z=3*x.*y^2; surf(x,y,z)
- 下列绘制三维曲面图形的代码正确的是( )。 A: x=0:0.1:10;y=0:0.1:10;z=x.^2+y.^2;surf(x,y,z) B: x=0:0.1:10;y=0:0.1:10;z=x^2+y^2;mesh(x,y,z) C: x=0:0.1:10;[x,y]=meshgrid(x);z=x.^2+y.^2;mesh(x,y,z) D: x=0:0.1:10;[x,y]=meshgrid(x);z=x^2+y^2;surf(x,y,z)
- 一空间曲线由参数方程x=t y=sin(2t) , -3<t<3z=cos(3t*t)表示,绘制这段曲线可以由下列哪组语句完成。 A: t=-3:0.1:3;x=t;y=sin(2*t);z=cos(3*t.*t);plot3(x, y, z, t) B: t=-3:0.1:3;x=t;y=sin(2*t);z=cos(3*t*t);plot3(x, y, z) C: t=-3:0.1:3;y=sin(2*t);z=cos(3*t.*t);plot3(x, y, z) D: t=-3:0.1:3;x=t;y=sin(2*t);z=cos(3*t.*t);plot3(x, y, z) E: x=-3:0.1:3;y=sin(2*x);z=cos(3*x.*x);plot3(x, y, z)
- 已知int x=1,y=2,z=3;执行if(x>y) z=x;x=y;y=z;后x,y,z的值为( ) A: x=1,y=2,z=3 B: x=2,y=3,z=3 C: x=2,y=3,z=1 D: x=2,y=3,z=2
- 已知int x=1,y=2,z=3;以下语句执行后x,y,z的值是( ). if(x>y) z=x; x=y; y=z; A: x=1, y=2, z=3 B: x=2, y=3, z=3 C: x=2, y=3, z=1 D: x=2, y=3, z=2