function sinewave2D = MakeSineApertureInputdlg(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=inputdlg({'radious of the grating'}); radius=str2double(radius); 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