title: Pushbutton zoom in and zoom out in GUI
body: <p>I need code to pushbuttons "zoom in", "zoom out" for my image. Trying to used this but wrong. Please, help me. I work with the  MATLAB Gui.</p>
  
  <p><a href="https://i.stack.imgur.com/26Wq6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/26Wq6.jpg" alt="enter image description here"></a></p>
  
  <pre><code>function btnZoomIn_Callback(hObject, eventdata, handles)
  uicontrol('Style','pushbutton','String','ZoomIn','Units','pixels',...
  'Position',[90 10 60 20],'Enable','off',...
  'Tag','btnZoomIn','Callback',@btnZoomIn_Callback);
  h = guihandles(hObject);
  set(h.btnZoomOut,'Enable','on')
  data = guidata(hObject);
  data.magnif = data.magnif+1;
  guidata(hObject, data)
  
  function btnZoomOut_Callback(hObject, eventdata, handles)
  uicontrol('Style','pushbutton','String','Zoom Out','Units','pixels',...
  'Position',[160 10 60 20],'Enable','off',...
  'Tag','btnZoomOut','Callback',@btnZoomOut_Callback);
  
  h = guihandles(hObject);
  data = guidata(hObject);
  if data.magnif &gt; 1
   data.magnif = data.magnif-1;
    if data.magnif == 1
  </code></pre>