Plotting square apertures on Matlab

I want to plot the aperture of two squares that are 70 units apart(centre to centre) and each has a width of 40 units.
I have this code so far. I know that for one square at the origin then aperture=abs(x)<0.5*b I want to modify the formula I have for one square to make it fit for the two square apertures then plot it.
Is my formula for Aperture correct in the code below?
I want to be able to find the fourier transform in 2D of the aperture function
b=40.0; % Width of slit in nm
delx=100.0; % Sampling rate in nm
nx=512; % number of points
x=linspace(-nx*delx/2,(nx-2)*delx/2,nx);
[xx,yy]=meshgrid(x,x);
Aperture=(abs(x-10)< 0.5*b & abs(x-80)<0.5*b);
figure(1);
imagesc(Aperture);
axis image; colorbar;
This is what my code is giving so far, how can I fix it?

답변 (0개)

카테고리

도움말 센터File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

태그

질문:

CH
2021년 5월 19일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by