标签:loading csdn ext size oss class plot end sub
基于matlab 仿真圆孔的菲涅尔衍射
%圆孔衍射 菲涅尔
clear
lamda=633*10^(-6);
k=2*pi/lamda;%?¨??
p=1;
z=100;
fu=sqrt(-1);
d=0.1;
[X,Y]=meshgrid(-p:0.005:p,-p:0.005:p);
for i=1:size(X,1)
for j=1:size(Y,1)
if X(i,j).^2+Y(i,j).^2<=(d/2)^2
A(i,j)=1;
else
A(i,j)=0;
end
end
end
for i=1:size(X,1)
for j=1:size(Y,1)
A1(i,j)=A(i,j)*exp(fu*k/(2*z)*(X(i,j).^2+Y(i,j).^2));
end
end
figure(1)
subplot(2,2,1);
imshow(A,[])
%A1=A*exp(j*k/(2*z)*)
afft=fft2(A1);
aabs=abs(afft);
aabss1=fftshift(aabs);
aabss2=aabss1.*exp(fu*k*z)/(fu*lamda*z);
aabss=abs(aabss2);
subplot(2,2,2);
imshow(aabss,[])
colormap(gray);
subplot(2,2,3);
[i,j]=size(aabss);
C=(i+1)/2;
B=aabss(C,:);
x=-p:0.005:p;
plot(x,B)
版本:2014a
完整代码或代写加1564658423
【物理应用】基于matlab仿真圆孔菲涅尔衍射【含Matlab源码 522期】
标签:loading csdn ext size oss class plot end sub
原文地址:https://www.cnblogs.com/homeofmatlab/p/14941959.html