Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.63 KB  |  hits: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to find out how many figures are currently opened?
  2. numel(get(0,'Children'));
  3.        
  4. function h = findobjhelper( varargin )
  5.  
  6. %Copyright 2009-2010 The MathWorks, Inc.
  7.  
  8. allowHVHandles = true;
  9.  
  10. nin = nargin;
  11. rootHandleVis = builtin( 'get', 0, 'ShowHiddenHandles' );
  12.  
  13. % See if 'flat' keyword is present
  14. hasflat = false;
  15. if (nin > 1)
  16.     if strcmp( varargin{2}, 'flat' ) % Does the 'flat' keyword exist
  17.         hasflat = true;
  18.     end
  19. end
  20.  
  21. if nin == 0
  22.     if feature('HgUsingMatlabClasses')
  23.         h = findobjinternal( 0, '-function', @findobjfilter );  
  24.     else
  25.         h = findobjinternal(0);
  26.     end
  27.        
  28. length(findobj('Type','figure'))