function epeak
%  A shiny surface (peaks) is created with the combination
%  of surf, light, and shading commands, demonstrating
%  control of surface reflectance and lighting with MATLAB 5.
%
%  Filename: epeak.m

%  Yama Habibzai
%   Copyright (c) 1984-98 by The MathWorks, Inc. All Rights Reserved
%  $Revision: 1.7 $
%  $Date: 1997/11/21 19:39:06 $

figs = allchild(0);
figName = findobj(figs, 'Name', 'Peaks Plot');

if isempty(figName)
  figurePos = getfgpos(400, 330);
  figurePos(1) = figurePos(1)+88;
  figurePos(2) = figurePos(2)+31;
  
  fig = figure('Position', figurePos,...
      'Color', [1 1 1],...
      'NumberTitle', 'off',...
      'Name', 'Peaks Plot',...
      'Tag', 'FrontImage',...
      'ColorMap', [1 0 0],...
      'Resize', 'off');
  axes('Parent', fig, 'Position', [.02 .06 .95 .95]);
  
  [X, Y, Z] = peaks;
  surf(X, Y, Z);
  set(gca, 'CameraPosition', [-27 -35 69],...
      'Zlim', [-5 5],...
      'Xlim', [-3 3],...
      'Ylim', [-3 3], 'Visible', 'off');
  frame = uicontrol('Units','pixels', ...
      'Position',[330 10 55 55], ...
      'BackGroundColor', [.7 .7 .7],...
      'Style','frame', ...
      'Tag','Frame1');
  push1 = uicontrol('Units','pixels', ...
      'Position',[335 15 45 20], ...
      'callback', 'close',...
      'String', 'Close',...
      'Tag','Pushbutton1');
  push1 = uicontrol('Units','pixels', ...
      'Position',[335 40 45 20], ...
      'callback', 'helpwin(help(''epeak''), ''Peaks Plot'');',...
      'String', 'Info',...
      'Tag','Pushbutton1');
  
  light('Position', [ 1 0 1], 'Style', 'Infinite');
  shading interp;
  lighting phong;
  material default;
end



