title: Real time plot in MATLAB
body: <p>I'm very new to MATLAB and I was trying to display a real time plot of some calculations. I have an <code>N</code> sized vector and I work with <code>m</code> values at a time (say <code>m = N/4</code>), so I want to plot the first <code>m</code> values and then as soon as the second <code>m</code> values are calculated have them replace the first plot.</p>
  
  <p>My approach was as follows:</p>
  
  <pre><code>for i=1:N,
    ...
    //compute m
    ...
    plot(m);
  end;
  </code></pre>
  
  <p>but it fails to update the plot in every loop and waits for all the loops to finish to plot the data. My question is: Should I use another function instead of <code>plot</code> or could I add some delay in each loop?</p>
  
  <p>I think there must be a way I'm not aware of for updating the plot instead of re-plotting it every time.</p>