home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / GRAPHICS.DI$ / CLF.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  674 b   |  32 lines

  1. function ret_fig = clf(opt_reset)
  2. %CLF     Clear Figure.
  3. %     CLF deletes all objects from the current figure.
  4. %    CLF RESET deletes everything and also resets all figure properties,
  5. %    except position, to their default values.
  6. %
  7. %    See also CLA, RESET, HOLD.
  8.  
  9. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  10.  
  11. fig = gcf;
  12.  
  13. % Delete all figure children.
  14. kids = get(fig,'Children');
  15. for i = 1:max(size(kids))
  16.     delete(kids(i));
  17. end
  18. if (nargout ~= 0)
  19.     ret_fig = fig;
  20. end
  21.  
  22. % Do reset, if requested
  23. if nargin == 1
  24.     if strcmp(opt_reset,'reset')
  25.         reset(fig);
  26.     else
  27.         error('Unknown command option.')
  28.     end
  29. elseif nargin > 1
  30.     error('Unknown command option.')
  31. end
  32.