扬州大学MATLAB实验714docWord文档格式.docx
- 文档编号:15768102
- 上传时间:2022-11-16
- 格式:DOCX
- 页数:29
- 大小:544.75KB
扬州大学MATLAB实验714docWord文档格式.docx
《扬州大学MATLAB实验714docWord文档格式.docx》由会员分享,可在线阅读,更多相关《扬州大学MATLAB实验714docWord文档格式.docx(29页珍藏版)》请在冰豆网上搜索。
holdoff;
plot(x'
[y1'
y2'
])
plot(x,y1,'
c:
'
x,y2,'
ro'
)
figure
(1);
plot(x,y1);
figure
(2);
plot(x,y2);
subplot(221);
subplot(222);
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));
2*pi/8:
y=sin(x);
plot(x,y,'
o'
);
xi=0:
yi=spline(x,y,xi);
plot(xi,yi,'
m'
whitebg
whitebg('
b'
k'
2)函数绘图。
fplot('
sin'
[04*pi])
f='
sin(x)'
;
fplot(f,[04*pi])
sin(1/x)'
[0.010.1],1e-3)
[tan(x),sin(x),cos(x)]'
[-2*pi,2*pi,-2*pi,2*pi])
symsx
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);
2)极坐标绘图。
t=0:
2*pi/180:
mo=cos(2*t);
polar(t,mo);
3)直方图。
y=sin(t);
bar(t,y)
4)离散棒图
stairs(t,y)
5)阶梯图。
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'
ezplot(y1,[0,5]);
ezplot(y2,[0,5]);
axis([0,5,-0.1,0.2])
title('
二阶系统时间响应'
xlabel('
时间t'
ylabel('
响应幅值y'
gtext('
零输入响应'
零状态响应'
grid;
(4)三维绘图
1)三维线图。
pi/50:
10*pi;
plot3(sin(t),cos(t),t);
comet3(sin(t),cos(t),t);
2)单变量高度网线图。
Z2=[11;
1-1];
Z4=[Z2Z2;
Z2-Z2];
Z8=[Z4Z4;
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:
2;
r=[t1-t2+2];
[X,Y,Z]=cylinder(r,40);
5)视角修饰。
[X,Y,Z]=cylinder(r,30);
subplot(2,2,1);
mesh(X,Y,Z);
view(0,0);
subplot(2,2,2);
view(-20,20);
subplot(2,2,3);
view(-30,30);
subplot(2,2,4);
view(-40,40);
6)MATLABA暖色(hot)函数色图。
peaks(20);
z=3*(1-x).^2.*exp(-(x.^2)-(y+1).^2)...
-10*(x/5-x.^3-y.^5).*exp(-x.^2-y.^2)...
-1/3*exp(-(x+1).^2-y.^2)
axis('
off'
colormap(hot);
colorbar('
horiz'
7)光照修饰。
surfl(peaks(20));
shadinginterp;
8)表面修饰。
subplot(131);
peaks(20);
shadingflat;
subplot(132);
shadinginterp;
subplot(133);
shadingfaceted;
-1/3*exp(-(x+1).^2-y.^2)
9)透视与消隐。
P=peaks(30);
mesh(P);
hiddenoff;
hiddenon;
10)裁剪修饰。
P(20:
23,9:
15)=NaN*ones(4,7);
meshz(P);
meshc(P);
11)水线修饰。
waterfall(peaks(20))
colormap([100])
12)等高线修饰。
contour(peaks(20),6)
contour3(peaks(20),10)
clabei(contour(peaks(20),4))
clabel(contour(peaks(20),4))
clabel(contour3(peaks(20),3))
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 扬州 大学 MATLAB 实验 714 doc