title: Matlab gui WindowButtonMotionFcn crashes when called too often?
body: <p>I've set <code>WindowButtonMotionFcn</code> to my callback which plots three plots, with the data depending on mouse position. However this seems to be too much for MATLAB to handle, because after moving my mouse around a bit, the GUI stops responding.</p>
  
  <p>I use this code (copied parts from someone):</p>
  
  <pre><code>set(handles.figure1, 'windowbuttonmotionfcn', @hover_Callback);
  
  function hover_Callback(hObject, handles, eventdata)
  inside = false;
  
  pos = get(handles.axes1, 'currentpoint');
  xlim = get(handles.axes1, 'XLim');
  ylim = get(handles.axes1, 'YLim');
  
  if (pos(1,1) &gt; max(xlim(1), 1) &amp;&amp; ...
          pos(1,1) &lt; xlim(2) &amp;&amp; ...
          pos(1,2) &gt; ylim(1) &amp;&amp; ...
          pos(1,2) &lt; ylim(2))
      inside = true;
  end
  if ~inside
      return
  end
  ix = round(pos(1,1));
  iy = round(pos(2,2));
  axes(handles.axes2); cla; plot(squeeze(t2(ix,iy,:)), squeeze(d2(ix,iy,:)));
  axes(handles.axes3); cla; plot(squeeze(t3(ix,iy,:)), squeeze(d3(ix,iy,:)));
  axes(handles.axes4); cla; plot(squeeze(t4(ix,iy,:)), squeeze(d4(ix,iy,:)));
  </code></pre>
  
  <p>This causes my GUI to stop responding, without error codes. If I then quit it and start it again the whole of MATLAB stops responding. Anyone knows what could be happening and how I can fix this? Maybe I'm somehow clogging my memory?</p>