a=1e-3D=1
ym=3*lam*D/a
ny=51
ys=linspace(-ym,ym,ny)
np=51
yp=linspace(0,a,np)
for i=1:ny
sinphi=ys(i)/D
alpha=2*pi*yp*sinphi/lam
sumcos=sum(cos(alpha))
sumsin=sum(sin(alpha))
B(i,:)=(sumcos^2+sumsin^2)/np^2
end
N=255
Br=(B/max(B))*N
subplot(1,2,1)
image(ym,ys,Br)
colormap(gray(N))
subplot(1,2,2)
plot(B,ys)
%矩孔衍射的解析计算clear
R=0.1
lambda=1.064e-3
k=2*pi/lambda
z=1.0e3
xmax=8*1.22*lambda/2/R*z
x=linspace(-xmax,xmax,200)
y=x
[x,y]=meshgrid(x,y)
IF=sin(k*x*R/z).ˆ2.*sin(k*y*R/z).ˆ2./(k*x/2/z).ˆ2./(k*y/2/z).ˆ2/lambdaˆ2/zˆ2
surf(x,y,IF.ˆ(1/2))
colormap(’hot’)
axis equal
shading interp
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)