This is a static copy of a profile report

Home

graphics/private/restore (40 calls, 4.481 sec)
Generated 05-Aug-2011 13:03:32 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/graphics/private/restore.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
print>LocalPrintsubfunction40
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
33
pj = restorehg( pj, h );
404.449 s99.3%
32
if isfigure(h)
400.022 s0.5%
51
set( 0, 'showhiddenhandles', h...
400.011 s0.2%
53
if err
400 s0%
40
if ~isempty( pj.Orientation )
400 s0%
All other lines  0.000 s0.0%
Totals  4.481 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
graphics/private/restorehgfunction404.449 s99.3%
graphics/private/isfigurefunction400.022 s0.5%
graphics/private/setsetfunction400 s0%
graphics/private/useOriginalHGPrintingfunction400 s0%
Self time (built-ins, overhead, etc.)  0.011 s0.2%
Totals  4.481 s100% 
Code Analyzer results
Line numberMessage
21Use || instead of | as the OR operator in (scalar) conditional statements.
Coverage results
[ Show coverage for parent directory ]
Total lines in function55
Non-code lines (comments, blank lines)28
Code lines (lines that can run)27
Code lines that did run15
Code lines that did not run12
Coverage (did run/can run)55.56 %
Function listing
   time   calls  line
1 function pj = restore( pj, h )
2 %RESTORE Reset a Figure or Simulink model after printing.
3 % When printing a model or Figure, some properties have to be changed
4 % to create the desired output. RESTORE resets the properties back to
5 % their original values.
6 %
7 % Ex:
8 % pj = RESTORE( pj, h ); %modifies PrintJob pj and Figure/model h
9 %
10 % See also PRINT, PRINTOPT, PREPARE, RESTOREHG, RESTOREUI.
11
12 % Copyright 1984-2009 The MathWorks, Inc.
13 % $Revision: 1.4.4.3 $ $Date: 2009/12/28 04:17:50 $
14
40 15 error( nargchk(2,2,nargin) )
16
40 17 if (~useOriginalHGPrinting())
18 error('MATLAB:Print:ObsoleteFunction', 'The function %s should only be called when original HG printing is enabled.', upper(mfilename));
19 end
20
40 21 if ~isequal(size(h), [1 1]) | ~ishandle( h )
22 error('MATLAB:print:InvalidHandle', 'Need a handle to a Figure or model.' )
23 end
24
25 %Need to see everything when printing
40 26 hiddenH = get( 0, 'showhiddenhandles' );
40 27 set( 0, 'showhiddenhandles', 'on' )
28
40 29 try
40 30 err = 0;
31
0.02 40 32 if isfigure(h)
4.45 40 33 pj = restorehg( pj, h );
40 34 end
35
40 36 setset( h, 'paperunits', pj.PaperUnits );
40 37 pj.PaperUnits = ''; %not needed anymore
38
39 %May have changed orientation because of device
40 40 if ~isempty( pj.Orientation )
41 setset(h,'paperorientation', pj.Orientation)
42 pj.Orientation = '';
43 end
44
45
46 catch ex
47 err = 1;
48 end
49
50 %Pay no attention to the objects behind the curtain
0.01 40 51 set( 0, 'showhiddenhandles', hiddenH )
52
40 53 if err
54 rethrow( ex )
55 end