title: Generate a Rectangular Pulse in MATLAB
body: <p>I need to create a rectangular pulse with <code>width = 7</code> and a range <code>(-T/2, T/2)</code> where <code>T</code> 59 msec.</p>
  <p>I wrote this code but I'm not sure if that's correct.</p>
  <pre class="lang-matlab prettyprint-override"><code>w = 7;
  T = 59;
  t = -T/2:1:T/2;
  
  rect = rectpuls(t, w);
  plot(t, rect);
  </code></pre>
  <p>This code generates a rectangular pulse but I'm not sure if it's right. Also, I'm not quite sure what the <code>t = -T/2:1:T/2;</code> means. I mean the range is from -29.5 to 29.5 with step <strong>1</strong>. When I set this to <strong>0.1</strong> or <strong>0.01</strong> my pulse is better. Why does this affect my output?</p>
  <p>Note that the second thing I have to do is to create a periodic sequence of clock pulses. I don't know if this affects the way I must implement my initial rectangular pulse.</p>