matlab上机习题6MATLAB70三维绘图.docx
- 文档编号:7002169
- 上传时间:2023-05-10
- 格式:DOCX
- 页数:15
- 大小:2.26MB
matlab上机习题6MATLAB70三维绘图.docx
《matlab上机习题6MATLAB70三维绘图.docx》由会员分享,可在线阅读,更多相关《matlab上机习题6MATLAB70三维绘图.docx(15页珍藏版)》请在冰点文库上搜索。
matlab上机习题6MATLAB70三维绘图
实验六MATLAB7.0三维绘图
实验目的:
①掌握绘制三维图能形的方法;
②掌握图形修饰处理方法;
知道图像处理方法,了解动画制作方法。
实验要求:
给出程序和实验结果。
实验内容:
一、绘制三维曲线
二、绘制三维曲面图z=sin(x+sin(y))-x/10。
三、绘制z=x2+y2的三维网线图形;
四、绘制三维陀螺锥面;
(仅供参考:
t1=0:
0.1:
0.9;
t2=1:
0.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:
0.1:
10;
x=sin(t);
y=cos(t);
z=t.*sin(t).*cos(t);
plot3(x,y,z)
2
[x,y]=meshgrid(0:
0.1:
10);
z=sin(x+sin(y))-x/10;
mesh(x,y,z)
3
[x,y]=meshgrid(0:
0.1:
10);
z=y.*y+x.*x;
mesh(x,y,z)
4
t1=0:
0.1:
0.9;
t2=1:
0.1:
2;
r=[t1-t2+2];
[x,y,z]=cylinder(r,30);
surf(x,y,z);
grid
5
x=-8:
0.1:
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);
surf(x,y,z);
6
[x,y,z]=sphere(25);
subplot(1,2,1);
surf(x,y,z);
axisequal;
light('posi',[0,1,0]);
shadinginterp;
holdon;
plot3(0,1,1,'p');
text(0,1,1,'light');
subplot(1,2,2);
surf(x,y,z);
axisequal;
light('posi',[1,0,1]);
shadinginterp;
holdon;
plot3(1,0,1,'p');
text(1,0,1,'light');
7
[x,y,z]=peaks(10);
surf(x,y,z)
8
[x,y]=meshgrid([-2:
0.1:
2]);
z=x.*exp(-x.^2-y.^2);
subplot(2,2,1);
plot3(x,y,z)
subplot(2,2,2);
mesh(x,y,z);
subplot(2,2,3);
surf(x,y,z);
subplot(2,2,4);
surf(x,y,z),shadinginterp
9surf(peaks(30));
colormap(hot)
colormap(cool)
colormap(lines)
10
[x,y,z]=sphere(30);
mesh(x,y,z)
[x,y,z]=sphere(30);
mesh(x,y,z),hiddenoff
11axissquare
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- matlab上机习题6 MATLAB70三维绘图 matlab 上机 习题 MATLAB70 三维 绘图