title: When I use the Zoom tools of matlab how i detect if i use mouse scroll?
body: <p>I developed this code to see if the user did zoom in or zoom out on a figure in matlab</p>
  
  <pre><code>function demo3
  
  MainFig = figure;
  x = sin(theta) + 0.75*rand(1,300);
  y = cos(theta) + 0.75*rand(1,300);
  a = 40;
  hs=scatter(x,y,a,'MarkerEdgeColor',[0 .5 .5],...
  'MarkerFaceColor',[0 .7 .7],...
  'LineWidth',1.5);        
  h = zoom;
  
  set(MainFig, 'WindowScrollWheelFcn', @figure1_WindowScrollWheelFcn);
  set(h, 'ActionPostCallback', @mypostcallback);
  
  function mypostcallback(h, eventdata)
  disp('INFO: Direction')
  h2 = zoom;
  get(h2,'Direction')
  
  function figure1_WindowScrollWheelFcn(hObject, eventdata, handles)
  if eventdata.VerticalScrollCount &gt; 0
      disp ('Scrool Up ')
  else
      disp ('Scrool Down ')
  end
  </code></pre>
  
  <p>The problem is if I run the code and I use a mouse scroll the information is correct and detect if i do scroll up or down. But if I use the Zoom tools and press in zoom in the information is correct relatively to direction but if I use the mouse scroll up and down the information is the same: </p>
  
  <blockquote>
    <p>INFO: Direction</p>
    
    <p>ans =</p>
    
    <p>in</p>
  </blockquote>
  
  <p>I need a code that detects if I do a zoom in or zoom out either with the Zoom tool or with the scrool mouse. </p>