This is a static copy of a profile reportHome
hold (576 calls, 0.240 sec)
Generated 05-Aug-2011 13:03:26 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/graphics/hold.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
35 | ax = gca; | 576 | 0.066 s | 27.3% |  |
46 | nexta = get(ax,'NextPlot'); | 576 | 0.055 s | 22.7% |  |
32 | [ax,args,nargs] = axescheck(va... | 576 | 0.033 s | 13.6% |  |
62 | setappdata(ax,'PlotHoldStyle',... | 392 | 0.022 s | 9.1% |  |
47 | nextf = get(fig,'NextPlot'); | 576 | 0.022 s | 9.1% |  |
All other lines | | | 0.044 s | 18.2% |  |
Totals | | | 0.240 s | 100% | |
Children (called functions)
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 72 |
Non-code lines (comments, blank lines) | 33 |
Code lines (lines that can run) | 39 |
Code lines that did run | 25 |
Code lines that did not run | 14 |
Coverage (did run/can run) | 64.10 % |
Function listing
time calls line
1 function hold(varargin)
2 %HOLD Hold current graph
3 % HOLD ON holds the current plot and all axis properties so that
4 % subsequent graphing commands add to the existing graph.
5 % HOLD OFF returns to the default mode whereby PLOT commands erase
6 % the previous plots and reset all axis properties before drawing
7 % new plots.
8 % HOLD, by itself, toggles the hold state.
9 % HOLD does not affect axis autoranging properties.
10 %
11 % HOLD ALL holds the plot and the current color and linestyle so
12 % that subsequent plotting commands will not reset the color and
13 % linestyle.
14 %
15 % HOLD(AX,...) applies the command to the Axes object AX.
16 %
17 % Algorithm note:
18 % HOLD ON sets the NextPlot property of the current figure and
19 % axes to "add".
20 % HOLD OFF sets the NextPlot property of the current axes to
21 % "replace".
22 %
23 % See also ISHOLD, NEWPLOT, FIGURE, AXES.
24
25 % Copyright 1984-2008 The MathWorks, Inc.
26 % $Revision: 5.9.4.10 $ $Date: 2008/12/15 08:52:48 $
27
28 % Parse possible Axes input
0.01 576 29 error(nargchk(0,2,nargin));
30
31 % look for leading axes (must not be a vector of handles)
0.03 576 32 [ax,args,nargs] = axescheck(varargin{:});
33
576 34 if isempty(ax)
0.07 576 35 ax = gca;
576 36 end
576 37 fig = get(ax,'Parent');
0.02 576 38 if ~strcmp(get(fig,'Type'),'figure')
39 fig = ancestor(fig,'figure');
40 end
41
576 42 if ~isempty(args)
576 43 opt_hold_state = args{1};
576 44 end
45
0.05 576 46 nexta = get(ax,'NextPlot');
0.02 576 47 nextf = get(fig,'NextPlot');
576 48 hold_state = strcmp(nexta,'add') && strcmp(nextf,'add');
576 49 if(nargs == 0)
50 if(hold_state)
51 set(ax,'NextPlot','replace');
52 disp('Current plot released');
53 else
54 set(fig,'NextPlot','add');
55 set(ax,'NextPlot', 'add');
56 disp('Current plot held');
57 end
58 setappdata(ax,'PlotHoldStyle',false);
576 59 elseif(strcmp(opt_hold_state, 'on'))
392 60 set(fig,'NextPlot','add');
392 61 set(ax,'NextPlot','add');
0.02 392 62 setappdata(ax,'PlotHoldStyle',false);
184 63 elseif(strcmp(opt_hold_state, 'off'))
0.01 182 64 set(ax,'NextPlot', 'replace');
182 65 setappdata(ax,'PlotHoldStyle',false);
2 66 elseif(strcmp(opt_hold_state, 'all'))
2 67 set(fig,'NextPlot','add');
2 68 set(ax,'NextPlot','add');
2 69 setappdata(ax,'PlotHoldStyle',true);
70 else
71 error('MATLAB:hold:UnknownOption', 'Unknown command option.');
72 end