This is a static copy of a profile report

Home

hold (50 calls, 0.062 sec)
Generated 18-Mar-2011 23:31:43 using cpu time.
M-function in file /Applications/MATLAB_R2010a.app/toolbox/matlab/graphics/hold.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
generateBEMmeshM-function48
plotDeformedProfileM-function2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
47
nextf = get(fig,'NextPlot');
500.031 s50.0%
37
fig = get(ax,'Parent');
500.010 s16.7%
35
ax = gca;
500.010 s16.7%
32
[ax,args,nargs] = axescheck(va...
500.010 s16.7%
65
setappdata(ax,'PlotHoldStyle',...
250 s0%
All other lines  0 s0%
Totals  0.062 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
gcfM-function500.010 s16.7%
axescheckM-function500.010 s16.7%
Self time (built-ins, overhead, etc.)  0.041 s66.7%
Totals  0.062 s100% 
M-Lint results
No M-Lint messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function72
Non-code lines (comments, blank lines)33
Code lines (lines that can run)39
Code lines that did run21
Code lines that did not run18
Coverage (did run/can run)53.85 %
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
50 29 error(nargchk(0,2,nargin));
30
31 % look for leading axes (must not be a vector of handles)
0.01 50 32 [ax,args,nargs] = axescheck(varargin{:});
33
50 34 if isempty(ax)
0.01 50 35 ax = gca;
50 36 end
0.01 50 37 fig = get(ax,'Parent');
50 38 if ~strcmp(get(fig,'Type'),'figure')
39 fig = ancestor(fig,'figure');
40 end
41
50 42 if ~isempty(args)
50 43 opt_hold_state = args{1};
50 44 end
45
50 46 nexta = get(ax,'NextPlot');
0.03 50 47 nextf = get(fig,'NextPlot');
50 48 hold_state = strcmp(nexta,'add') && strcmp(nextf,'add');
50 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);
50 59 elseif(strcmp(opt_hold_state, 'on'))
25 60 set(fig,'NextPlot','add');
25 61 set(ax,'NextPlot','add');
25 62 setappdata(ax,'PlotHoldStyle',false);
25 63 elseif(strcmp(opt_hold_state, 'off'))
25 64 set(ax,'NextPlot', 'replace');
25 65 setappdata(ax,'PlotHoldStyle',false);
66 elseif(strcmp(opt_hold_state, 'all'))
67 set(fig,'NextPlot','add');
68 set(ax,'NextPlot','add');
69 setappdata(ax,'PlotHoldStyle',true);
70 else
71 error('MATLAB:hold:UnknownOption', 'Unknown command option.');
72 end