This is a static copy of a profile report

Home

Function details for captureFiguresThis is a static copy of a profile report

Home

captureFigures (Calls: 10, Time: 0.018 s)
Generated 28-Jun-2020 10:10:23 using performance time.
function in file /Applications/MATLAB_R2018a.app/toolbox/matlab/codetools/+internal/+matlab/+publish/captureFigures.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
...Figures>PublishFigures.leavingCellclass method10
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
19
oldHandles = allchild(0);
100.006 s35.0%
14
drawnow;
100.004 s23.6%
15
drawnow;
100.003 s16.2%
20
oldHandles = flipud(oldHandles...
100.002 s13.5%
40
oldFigures.id = [oldFigures.da...
100.001 s3.1%
All other lines  0.002 s8.6%
Totals  0.018 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
allchildfunction100.006 s33.0%
flipudfunction100.002 s11.6%
Self time (built-ins, overhead, etc.)  0.010 s55.4%
Totals  0.018 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function42
Non-code lines (comments, blank lines)24
Code lines (lines that can run)18
Code lines that did run14
Code lines that did not run4
Coverage (did run/can run)77.78 %
Function listing
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.