登录论坛

查看完整版本 : [求助]双缝干涉


grb1988
2008-12-01, 18:10
clc
clear
lam=500e-9
a=2e-3
d=1
m=500
ym=10*lam*d/a
ys=linspace(-ym,ym,m)
xs=ys
for i=1:m
r1=sqrt((ys(i)-a/2).^2+d^2)
r2=sqrt((ys(i)-a/2).^2+d^2)
phi=2*pi*(r2-r1)/lam
b(i,:)=4*cos(phi/2).^2
end
b
n=255
br=b.*n./10
subplot(1,2,1)
image(xs,ys,br)
colormap(gray(n))
subplot(1,2,2)
plot(ys,br)


请大家帮帮忙,哪错了