在使用surf绘制空间曲面时,需要先生成网格点矩阵。若绘图区域为-2A: 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)
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)
举一反三
- 绘制函数 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)
- 已知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
- 已知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=1 C: x=2,y=2,z=1 D: x=2,y=3,z=3
- 【单选题】Python中执行赋值语句x, y, z = 1, 2, 3后,再执行z, x, y = y, z, x,变量x、y、z中分别赋值为____。 A. x=1, y=2, z=3 B. x=3, y=1, z=2 C. x=2, y=1, z=3 D. x=3, y=2, z=1