绘制Z=5*x.^2-y.^2+3的三维表面图(即马鞍面), clear all;clc; [x,y]= ______ (-3:0.5:3); %产生xy平面网格坐标矩阵 z=5*x.^2-y.^2+3; figure; ______ (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)
- 绘制函数 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)
- 若x=[1 2 3 4 5];y=[2 -1 4 3 -2];则z=x.*y=()
- 函数 [img=197x96]1803dbfc46ca27a.png[/img]表示的曲面称为椭圆锥面,绘制这个曲面的程序是: A: s=-5:0.1:5;t=-5:0.1:5;[x, y]=meshgrid(s, t);z=sqrt(x.^2+y.^2);mesh(x,y,z) B: a=3;b=2;s=-5:0.1:5;t=-5:0.1:5;[x, y]=meshgrid(s, t);z=sqrt(x.^2/a/a+y.^2/b/b);mesh(x, y, z) C: a=3;b=2;s=-5:0.1:5;t=-5:0.1:5;[x, y]=meshgrid(s, t);z=sqrt(x.^2/a*a+y.^2/b*b);mesh(x, y, z) D: a=3;b=2;s=-5:0.1:5;t=-5:0.1:5;[x, y]=meshgrid(s, t);z=sqrt(x^2/a/a+y^2/b/b);mesh(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