📄 yangshiganshe.m
字号:
% 总程序
lanmda=632.8e-6;
D=2;
L=1000;
%单色光
x=-20:0.01:20;
I=YoungIF(lanmda,D,L,x);
I=I/max(I);
subplot(2,1,1);
plot(x,I);
subplot(2,1,2);
yy=[0,1];
n=0;
for k=-20:0.01:20
n=n+1
line([k,k],yy,'Color',[I(n),0,0]);
end
%准单色光 5% 矩形
deltaL=lanmda*0.05;
dL=0.01*deltaL;
II=x;
II(:)=0;
for tL=(lanmda-0.5*deltaL):dL:(lanmda+0.5*deltaL)
II=II+YoungIF(tL,D,L,x);
end
II=II/max(II);
figure;
subplot(2,1,1);
plot(x,II);
subplot(2,1,2);
n=0;
for k=-20:0.01:20
n=n+1;
line([k,k],yy,'Color',[II(n),0,0]);
end
%准单色光 10% 矩形
deltaL=lanmda*0.1;
dL=0.01*deltaL;
II=x;
II(:)=0;
for tL=(lanmda-0.5*deltaL):dL:(lanmda+0.5*deltaL)
II=II+YoungIF(tL,D,L,x);
end
II=II/max(II);
figure;
subplot(2,1,1);
plot(x,II);
subplot(2,1,2);
n=0;
for k=-20:0.01:20
n=n+1;
line([k,k],yy,'Color',[II(n),0,0]);
hold on;
end
w=1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -