title: MATLAB - updating plot in gui?
body: <p>Getting started with matlab guide, hit a stumbling block.  Got it as simple as I can as a toy gui to illustrate my problem.  A gui (named asas)  has a pushbutton and an axis. The callback of the button reads </p>
  
  <pre><code>axesHandle= findobj(gcf,'Tag','axes1');
  x=rand(randi(10+20,1),4);
  plot(axesHandle, x)
  </code></pre>
  
  <p>There's no other code written by me (guide wrote it).<br>
  The 1st time I push the button, everything is fine: the plot gets done.  The 2nd time around, I get an error, from the console:</p>
  
  <pre><code>Error using plot
  Vectors must be the same lengths.
  
  Error in asas&gt;pushbutton1_Callback (line 83)
  plot(axesHandle, x)
  
  Error in gui_mainfcn (line 96)
          feval(varargin{:});
  etc...
  </code></pre>
  
  <p>I want to plot the new data x, replacing the old one.<br>
  It looks like matlab is not replacing the data to plot, but somehow trying to append to the plot?</p>
  
  <p>I have searched, but haven't found anything that applies.  </p>