time   | Calls   |  line  | 
|---|
 |  |    1   | function oldFigures = captureFigures(oldHandles)
   | 
 |  |    2   | %CAPTUREFIGURES	Return figure information for later call to compareFigures
   | 
 |  |    3   | %   OLDFIGURES contains the information that can later be passed to
   | 
 |  |    4   | %   the compareFigures function
   | 
 |  |    5   | 
 
  | 
 |  |    6   | % Copyright 1984-2017 The MathWorks, Inc.
   | 
 |  |    7   | 
 
  | 
 |  |    8   | % The publishing tools use this.
   | 
 |  |    9   | 
 
  | 
 |  |   10   | % Call drawnow here to flush any changes/events that may have been
   | 
 |  |   11   | % triggered if the last loop of takepicture triggered a print.
   | 
 |  |   12   | % This drawnow could be taken out if the print of a uiflowcontainer does
   | 
 |  |   13   | % not trigger a resize (G354913).  It takes two.
   | 
  0.004   |      10   |   14  | drawnow; 
   | 
  0.003   |      10   |   15  | drawnow; 
   | 
 |  |   16   | 
 
  | 
 |  |   17   | % A structure representing the graphics hierarchy, starting with figures.
   | 
< 0.001   |      10   |   18  | if nargin == 0 
   | 
  0.006   |      10   |   19  |     oldHandles = allchild(0); 
   | 
  0.002   |      10   |   20  |     oldHandles = flipud(oldHandles); 
   | 
< 0.001   |      10   |   21  | end 
   | 
< 0.001   |      10   |   22  | numHandles = numel(oldHandles); 
   | 
< 0.001   |      10   |   23  | data = handle2struct([]); 
   | 
< 0.001   |      10   |   24  | oldFigures.data = data; 
   | 
 |  |   25   | 
 
  | 
 |  |   26   | % Recursively visit each node, modifying or removing it where appropriate.
   | 
< 0.001   |      10   |   27  | toRemove = false(1, numHandles); 
   | 
< 0.001   |      10   |   28  | for k = 1:numHandles 
   | 
 |  |   29   |     oldFigures.data(k).handle = oldHandles(k);
   | 
 |  |   30   |     oldFigures.data(k).properties = getToken(oldHandles(k));
   | 
 |  |   31   |     toRemove(k) = isequal(get(oldHandles(k),'Visible'),'off');
   | 
 |  |   32   | end
   | 
< 0.001   |      10   |   33  | oldFigures.data(toRemove) = []; 
   | 
 |  |   34   | 
 
  | 
 |  |   35   | % Since HANDLE2STRUCT([]) returns an empty structure of the appropriate
   | 
 |  |   36   | % form, we don't need to worry about compareFigures seeing differences
   | 
 |  |   37   | % between different kinds of empty structures.  (See below, in VISIT.)
   | 
 |  |   38   | 
 
  | 
 |  |   39   | % The "id" for graphics objects is the handle.
   | 
< 0.001   |      10   |   40  | oldFigures.id = [oldFigures.data.handle]; 
   | 
 |  |   41   | 
 
  | 
< 0.001   |      10   |   42  | end 
   | 
Other subfunctions in this file are not included in this listing.