%% Set Camera View Angle
% Create two push buttons, one that zooms in and another that zooms out. Set the range checking in the callback statements to keep the values for the camera view angle in the range greater than zero and less than 180. Then create a surface plot to zoom in and out on.

uicontrol('Style','pushbutton',...
  'String','Zoom In',...
  'Position',[20 20 60 20],...
  'Callback','if camva <= 1; return; else; camva(camva-1); end');

uicontrol('Style','pushbutton',...
  'String','Zoom Out',...
  'Position',[100 20 60 20],...
  'Callback',...
  'if camva >= 179; return; else; camva(camva+1); end');

surf(peaks);

% Copyright 2012 The MathWorks, Inc.