matlab上机习题6MATLAB70三维绘图Word文档下载推荐.docx
《matlab上机习题6MATLAB70三维绘图Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《matlab上机习题6MATLAB70三维绘图Word文档下载推荐.docx(15页珍藏版)》请在冰点文库上搜索。
![matlab上机习题6MATLAB70三维绘图Word文档下载推荐.docx](https://file1.bingdoc.com/fileroot1/2023-5/10/11970389-8268-4fc4-b435-e1c6475e48d4/11970389-8268-4fc4-b435-e1c6475e48d41.gif)
二、绘制三维曲面图z=sin(x+sin(y))-x/10。
三、绘制z=x2+y2的三维网线图形;
四、绘制三维陀螺锥面;
(仅供参考:
t1=0:
0.1:
0.9;
t2=1:
2;
r=[t1-t2+2];
[x,y,z]=cylinder(r,30);
surf(x,y,z);
grid
)
五、在xy平面内选择区域[-8,8]×
[-8,8],利用mesh、meshc、meshz和surf绘制
。
要求用子图在一个图形窗口中绘制。
六、绘制光照处理后的球面,取三个不同的光照位置进行比较。
(提示:
可以利用函数sphere和light)
七、利用peaks产生数据,绘制多峰曲面图。
八.
,当x和y的取值范围均为-2到2时,用建立子窗口的方法在同一个图形窗口中绘制出三维线图、网线图、表面图和带渲染效果的表面图。
九绘制peaks函数的表面图,用colormap函数改变预置的色图,观察色彩的分布情况。
十、用sphere函数产生球表面坐标,绘制不透明网线图、透明网线图、表面图和带剪孔的表面图。
十一、将5.9题中的带剪孔的球形表面图的坐标改变为正方形,以使球面看起来是圆的而不是椭圆的,然后关闭坐标轴的显示。
实验结果:
1
t=0:
10;
x=sin(t);
y=cos(t);
z=t.*sin(t).*cos(t);
plot3(x,y,z)
2
[x,y]=meshgrid(0:
10);
z=sin(x+sin(y))-x/10;
mesh(x,y,z)
3
z=y.*y+x.*x;
4
5
x=-8:
8;
y=x;
[x,y]=meshgrid(x,y);
m=sqrt(x.^2+y.^2);
z=sin(m)./m;
subplot(2,2,1);
mesh(x,y,z);
subplot(2,2,2);
meshc(x,y,z);
subplot(2,2,3);
meshz(x,y,z);
subplot(2,2,4);
6
[x,y,z]=sphere(25);
subplot(1,2,1);
axisequal;
light('
posi'
[0,1,0]);
shadinginterp;
holdon;
plot3(0,1,1,'
p'
);
text(0,1,1,'
light'
subplot(1,2,2);
[1,0,1]);
plot3(1,0,1,'
text(1,0,1,'
7
[x,y,z]=peaks(10);
surf(x,y,z)
8
[x,y]=meshgrid([-2:
2]);
z=x.*exp(-x.^2-y.^2);
surf(x,y,z),shadinginterp
9surf(peaks(30));
colormap(hot)
colormap(cool)
colormap(lines)
10
[x,y,z]=sphere(30);
mesh(x,y,z)
mesh(x,y,z),hiddenoff
11axissquare