matlab画函数图.docx
《matlab画函数图.docx》由会员分享,可在线阅读,更多相关《matlab画函数图.docx(12页珍藏版)》请在冰豆网上搜索。
matlab画函数图
(1)绘制1/(1+z)的图像,并验证罗朗展开函数。
(2)z=2*cplxgrid(30);
(3)cplxmap(z,1./(1+z+eps*(abs(z)==1)),5*pi)
(4)colorbar('vert')
(5)title('1/(1+z)')
(6)view(60,30)
(7)
(8)z1=z;
(9)z1(abs(z1)>=1)=NaN;
(10)w1=1;u1=1;
(11)fork=1:
100
(12)u1=u1.*z1;
(13)w1=w1+u1;
(14)end
(15)figure
(16)cplxmap(z1,w1)
(17)axis([-2,2,-2,2,-20,20])
(18)
(19)z2=z;
(20)z2(abs(z2)<=1)=NaN;
(21)w2=1./z2;u2=1./z2;
(22)fork=1:
100
(23)u2=u2./z2;
(24)w2=w2+u2;
(25)end
(26)figure
(27)cplxmap(z2,-w2)
(28)axis([-2,2,-2,2,-20,20])
(29)
(2)绘制指数函数e-z的图形和其泰勒展开的图形。
figure
(1)
z=5*cplxgrid(30);
cplxmap(z,exp(-z));
title('e^{-z}')
figure
(2)
w=1;
u=1;
fork=1:
15
u=u.*z./k;
w=w+u;
end
cplxmap(-z,w)
(3)求函数
在点z=3+i/2的导数。
f2=sym('sqrt((z-1)*(z-2))');
>>df2=diff(f2,'z')
df2=
1/2/((z-1)*(z-2))^(1/2)*(2*z-3)
>>vdf2=subs(df2,'z',3+i/2)
vdf2=
1.0409-0.0339i
(4)绘制函数z^3和z=0相交并且不含投影的图形。
z=cplxgrid(30);
cplxmap(z,z.^3);
colorbar('vert');
title('z^3')
>>z=cplxgrid(30);
cplxmap(z,z.^3);
colorbar('vert'),holdon
cplxmap(z,z=0);
•title('z^3')
练习4:
勒让德函数的母函数
[X,Z]=meshgrid([0:
0.1:
3],[0:
0.1:
2])
[Q,R]=cart2pol(X,Y);
R(find(R==1))=NaN;
u=1./sqrt(1-2.*R.*cos(Q)+R.^2);
meshc(X,Z,u)
Rin=R;
Rin(find(Rin>1))=NaN;
Rout=R;
Rout(find(Rout<1))=NaN;
Uin=1;
Uout=1./Rout;
fork=1:
20
Leg=legendre(k,cos(Q));
legk=squeeze(Leg(1,:
:
));
uin=Rin.^k.*legk;
uout=1./Rout.^(k+1).*legk;
Uin=uin+Uin;
Uout=Uout+uout;
end
figure
meshc(X,Z,Uin);
holdon
meshc(X,Z,Uout)
xlable('x')
•五,贝塞尔函数的母函数
•m=30;
•r=(0.3*m:
m)'/m;
•theta=pi*(-m:
m)/m;
•z=r*exp(i*theta);
•z(find(z==0))=NaN;
•figure
•cplxmap(z,exp(z-1./z))
•view(30,44)
•w=0
•fork=-20:
20
•u=besselj(k,3).*z.^k;
•w=w+u;
•end
•figure
•cplxmap(z,w)
•view(30,44)