title: matlab plot zoom automatically in script
body: <p>I would like to zoom a particular range in MATLAB subplot.</p>
  
  <p>For example:</p>
  
  <pre><code>xzoom = 1:end; 
  yzoom = 10;
  </code></pre>
  
  <p>I want the script to zoom automatically, only the above mentioned ranges.</p>
  
  <p>I have tried this this code:</p>
  
  <pre><code>hZoom = zoom(gcf);
  figure;plot(magic(10)); hCMZ = uicontextmenu;
  hZMenu = uimenu('Parent',hCMZ,'Label','Switch to pan',...
  'Callback','pan(gcbf,''on'')');
   hZoom = zoom(gcf);
  set(hZoom,'UIContextMenu',hCMZ);
  zoom('on').
  
  hZMenu = uimenu('Parent',hCMZ,'Label','Switch to pan',...
  'Callback','pan(gcbf,''on'')');
  </code></pre>
  
  <p>This gives the lens for me to zoom, but I don't want this. I want it to display the zoomed portion automatically.  How would I accomplish this?</p>