title: Rect Function/Square wave in MatLab
body: <p>I am trying to get a square wave of width 83.66.  Seeing as I am using for a deconvolution, I want it to be exact.  Here is what I have so far:</p>
  
  <pre><code>width = 83.66;
  x = linspace(-400,400,10000);
  
         a2 =  1.205e+004  ;
         al =  1.778e+005  ;
         b1 =       94.88  ;
         c1 =       224.3  ;
         d =       4.077  ;
  
  measured =  al*exp(-((abs((x-b1)./c1).^d)))+a2;
  
  p = 33*sinc( (x)/(2*width) );
  slit = abs(fftshift(ifft(p)));
  </code></pre>
  
  <p>I have a measured fit to my data and want to deconvolve it with my slit of width 83.66.  I tried to build the fourier transform of this and then use <code>ifft()</code> but that just gives me a delta function.  It may be a peak with little squiggles at the top, but I do not see it when I zoom in. Plus, my slit should be ~84 wide.  </p>
  
  <p>Any ideas on how I can get an accurate representation of the slit.  My other idea was something such as:</p>
  
  <pre><code>slit = zeros(length(x))
  
  slit(1:1+width) = 1
  </code></pre>