function sinewave2D = MakeSineApertureInput (xval, sf) % function that creates a vertical sinewave windowed by a circular aperture % % Inputs: % xval: for which the sinusoids is computed % sf: the saptial frequecy of the sinusoid % radius: the radiusl of the aperture in pixels % Outputs: a 2D sinusoidal grating image radius=input('please input the radius: '); if isempty(radius) radius=3; end onematrix=ones(size(xval)); sinewave=sin(xval*sf); sinewave2D=(onematrix'*sinewave); for r=1:length(xval) for c=1:length(xval) if xval(r).^2+xval(c).^2>radius^2 sinewave2D(r,c)=0; end end end