function Michelson(Wavelength)
% Michelson plot the interference images of different wave length
%
% Synopsis: Michelson(Wavelength)
%
% Input: Wavelength = length of wave used in the experiment
%
%
% Output: the experiment interference images
xmax=10;ymax=10;f=200;n=1.0;N=150;
R=zeros(N);R1=zeros(N);
x=linspace(-xmax,xmax,N);
y=linspace(-ymax,ymax,N);
%
%
%
for i=1:N
for j=1:N
R1(i,j)=sqrt(x(i)*x(i)+y(j)*y(j));
end
end
R=R1./f;
%
for k=0:15
d=0.39-0.00005*k;
M=cos(asin(n*sin(atan(R))));
B=cos(pi*(2*n*d.*M)/Wavelength).^2;
figure(gcf);
N=255;
Br=2.5*B*N;
image(x,y,Br);
colormap(gray(N));
set(gca,'XTick',[]);
set(gca,'YTick',[]);
drawnow
pause(0.3)
end
在命令窗口输入Michelson按回车键出现一下问题
??? Input argument "Wavelength" is undefined.
Error in ==> Michelson at 27
B=cos(pi*(2*n*d.*M)/Wavelength).^2;
% Michelson plot the interference images of different wave length
%
% Synopsis: Michelson(Wavelength)
%
% Input: Wavelength = length of wave used in the experiment
%
%
% Output: the experiment interference images
xmax=10;ymax=10;f=200;n=1.0;N=150;
R=zeros(N);R1=zeros(N);
x=linspace(-xmax,xmax,N);
y=linspace(-ymax,ymax,N);
%
%
%
for i=1:N
for j=1:N
R1(i,j)=sqrt(x(i)*x(i)+y(j)*y(j));
end
end
R=R1./f;
%
for k=0:15
d=0.39-0.00005*k;
M=cos(asin(n*sin(atan(R))));
B=cos(pi*(2*n*d.*M)/Wavelength).^2;
figure(gcf);
N=255;
Br=2.5*B*N;
image(x,y,Br);
colormap(gray(N));
set(gca,'XTick',[]);
set(gca,'YTick',[]);
drawnow
pause(0.3)
end
在命令窗口输入Michelson按回车键出现一下问题
??? Input argument "Wavelength" is undefined.
Error in ==> Michelson at 27
B=cos(pi*(2*n*d.*M)/Wavelength).^2;