title: heaviside function procudes different outputs in ezplot and fplot
body: <p>I'm new to MATLAB and I'm trying to plot a step function with <code>heaviside()</code>. I tried at first the following code:</p>
  
  <pre><code>f = @(x)heaviside(x+2) - heaviside(x-2);
  fplot(f, [-10 10])
  </code></pre>
  
  <p>The result:</p>
  
  <p><img src="https://i.stack.imgur.com/l7fY0.png" alt="enter image description here"></p>
  
  <p>With <code>ezplot</code>, the result is as I thought:</p>
  
  <pre><code>f = @(x)heaviside(x+2) - heaviside(x-2);
  ezplot(f, [-10 10])
  </code></pre>
  
  <p>The result:</p>
  
  <p><img src="https://i.stack.imgur.com/9mlnP.png" alt="enter image description here"></p>
  
  <p>What is the difference between <code>fplot</code> and <code>ezplot</code>? Thanks in advance!</p>