MATLAB的基本操作实验报告.doc
《MATLAB的基本操作实验报告.doc》由会员分享,可在线阅读,更多相关《MATLAB的基本操作实验报告.doc(12页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、1. Plot the following graph(1) Plotting the two curves under one coordinate system with different color代码:clear;x=-pi:pi/1000:pi;y=sin(x);plot(x,y,r:);hold on;x=-pi:pi/1000:pi;y=sin(3*x);plot(x,y,b);hold off;xlabel(x轴); ylabel(y轴);legend(y=sinx,y=sin(3x);运行结果:(2) Plotting the standard normal distrib
2、ution density function:代码:clear;x=-5:0.05:5;y=1/sqrt(2*pi)*exp(-x.2/2);plot(x,y)运行结果:(3)Using subplot command to plot 6 curves :代码:clear;x=-5*pi:0.05:5*pi;for i=1:6 subplot(2,3,i); y=sin(i*x); plot(x,y);end运行结果:(4)Plotting the curve: 代码:clear;x=-2*pi:0.01:2*pi;y=sin(2*x);polar(x,y)运行结果:(5)Plotting a
3、 series of curves under one polar coordinate system:代码:clear;x=-2*pi:0.01:2*pi;for a=1:2:5 y=a.*cos(2*x); polar(x,y); hold on;end运行结果:2Plotting the 3-D curves: 代码: cleart=-12*pi:0.05:12*pi;x=t.*sin(t);y=t.*cos(t);z=t;plot3(x,y,z)运行结果3. Plotting the surface: (mesh surf contour3) (1)代码:clearX=-5:0.01:
4、5;Y=X;x,y=meshgrid(X,Y);z=x.*y;mesh(x,y,z)运行结果:(2)* 代码:clear;close;X=-1:0.01:1;Y=X;x,y=meshgrid(X,Y);z=x.2/3+y.2/2;mesh(x,y,z);pausesurf(x,y,z);pausecontour3(x,y,z);pausemesh(x,y,z);运行结果:(3)*代码:clearX=-12:0.01:12;Y=X;x,y=meshgrid(X,Y);z=sin(sqrt(x.2+y.2)./sqrt(x.2+y.2);mesh(x,y,z)运行结果: (4) 代码: clear
5、;X=-12:0.05:12;Y=X;x,y=meshgrid(X,Y);z=0*x+0*y+6;mesh(x,y,z)运行结果:(5) 代码:clear;X=-5:0.05:5;Y=X;x,y=meshgrid(X,Y);z=cos(y).*sin(x);mesh(x,y,z)运行结果: 4.Plotting curves under a polar coordinate system:(1)*代码:clear;x=-10:0.01:10;y=5*cos(x)+4;polar(x,y)运行结果:(2) 代码:clear;x=-1:0.01:1;y=5./cos(x)-7;polar(x,y)
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- MATLAB 基本 操作 实验 报告
限制150内