一、matlab plot3 用法
%plot3(x,y,z)用来绘制3维曲线图,而不能绘制曲面图!就是把所有的
%(x,y,z)点连接在一起而画曲面图必须用surf和mesh函数,而这两个
%函数都需要知道对应x,y向量交叉点内所有点处的z值,所以得用
%x=-200:0.3:200;y=-200:0.1:200;
%[X,Y]=meshgrid(x,y);
%Z=X.*Y/sqrt(X.*X+Y.*Y)
%获得z值,再用mesh(X,
Y,
Z);绘曲面图
,下面为代码
x=-200:0.3:200;y=-200:0.1:200;
[X,Y]=meshgrid(x,y);
Z=X.*Y./sqrt(X.*X+Y.*Y);
mesh(X,Y,Z)
%希望能解决你的问题!
二、matlab plot3 mesh surf三种作图方法有什么区别
plot3(x1,y1,z1,x2,y2,z2,…,xn,yn,zn):例:t=0:0.1:1;x=sin(t);y=cos(t);z=t;plot3(x,y,z)
可绘n条线;plot函数也可化多条线
surf(x,y,z)或mesh(x,y,z):绘制三维曲面的网格图或表面图,
surfc()和surfl()分别绘制带有等高线和光照下的三维曲面,
meshc()和meshz()也有不同效果

