扬州大学MATLAB实验714.doc

  1. 1、本文档共26页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
扬州大学MATLAB实验714

1.实验目的 (1)学习MATLAB的各种二维绘图 (2)学习MATLAB的三维绘图 (3)MATLAB的绘图修饰 2.实验内容 在下面的实验操作中,认真记录每项操作的作用和目的。 (1)基本二维绘图 1)向量绘图 x=0:2*pi/100:2*pi; y1=sin(2*x);y2=cos(2*x); plot(x,y1) plot(x,y2) plot(x,y1,x,y2) plot(x,y1);hold on; plot(x,y2);hold off; plot(x,[y1 y2]) plot(x,y1,c:,x,y2,ro) figure(1);plot(x,y1); figure(2);plot(x,y2); figure(1);plot(x,y1); figure(2);plot(x,y2); subplot(221);plot(x,y1); subplot(222);plot(x,y2); subplot(223);plot(x,y1,x,y1+y2); subplot(224);plot(x,y2,x,y1-y2); w=0.01:0.01:10; G=1./(1+2*w*i); subplot(121);plot(G); subplot(122);plot(real(G),imag(G)); x=0:2*pi/8:2*pi;y=sin(x); plot(x,y,o);hold on; x=0:2*pi/8:2*pi;y=sin(x); plot(x,y,o);hold on; xi=0:2*pi/100:2*pi; yi=spline(x,y,xi); plot(xi,yi,m); whitebg whitebg(b) whitebg(k) 2)函数绘图。 fplot(sin,[0 4*pi]) f=sin(x);fplot(f,[0 4*pi]) fplot(sin(1/x),[0.01 0.1],1e-3) fplot([tan(x),sin(x),cos(x)],[-2*pi,2*pi,-2*pi,2*pi]) syms x f=exp(-0.5*x)*sin(x); ezplot(f,[0,10]) (2)多种二维绘图 1)半对数绘图 w=logspace(-1,1); g=20*log10(1./(1+2*w*i)); p=angle(1./(1+2*w*i))*180/pi; subplot(211);semilogx(w,g);grid; subplot(212);semilogx(w,p);grid; 2)极坐标绘图。 t=0:2*pi/180:2*pi; mo=cos(2*t); polar(t,mo); 3)直方图。 t=0:2*pi/8:2*pi; y=sin(t); bar(t,y) 4)离散棒图 t=0:2*pi/8:2*pi; y=sin(t); stairs(t,y) 5)阶梯图。 t=0:2*pi/8:2*pi; y=sin(t); stem(t,y) 6)彗星绘图。 t=-pi:pi/200:pi; comet(t,tan(sin(t))-sin(tan(t))); (3)图形注释 y1=dsolve(D2u+2*Du+10*u=0,Du(0)=1,u(0)=0,x); y2=dsolve(D2u+2*Du+10*u=1,Du(0)=0,u(0)=0,x); ezplot(y1,[0,5]);hold on;ezplot(y2,[0,5]); axis([0,5,-0.1,0.2]) title(二阶系统时间响应); xlabel(时间t);ylabel(响应幅值y); gtext(零输入响应); gtext(零状态响应); grid;hold off; (4)三维绘图 1)三维线图。 t=0:pi/50:10*pi; plot3(sin(t),cos(t),t); comet3(sin(t),cos(t),t); 2)单变量高度网线图。 Z2=[1 1;1 -1]; Z4=[Z2 Z2;Z2 -Z2]; Z8=[Z4 Z4;Z4 -Z4]; mesh(Z8); 3)3变量马鞍面网线图。 x=-4:0.5:4;y=x; [X,Y]=meshgrid(x,y); Z=X.^2-Y.^2; 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,40); mesh(X,Y,Z); 5)视角修饰。 t1=0:0.

文档评论(0)

haihang2017 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档