This is a static copy of a profile reportHome
graphics/private/setset (160 calls, 0.011 sec)
Generated 05-Aug-2011 13:03:35 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/graphics/private/setset.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 | sl = []; | 160 | 0.011 s | 100.0% |  |
54 | if ~isempty(sl) | 160 | 0 s | 0% |  |
52 | end | 160 | 0 s | 0% |  |
51 | end | 160 | 0 s | 0% |  |
50 | set( hg, propName, propValue ) | 160 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.011 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 85 |
Non-code lines (comments, blank lines) | 36 |
Code lines (lines that can run) | 49 |
Code lines that did run | 15 |
Code lines that did not run | 34 |
Coverage (did run/can run) | 30.61 % |
Function listing
time calls line
1 function setset( h, propName, propValue )
2 %SETSET Call SET on a Handle Graphics object or SET_PARAM on a Simulink object.
3 % SETSET(H, NAME, VALUE ) SET property pair for Handle Graphics object H.
4 % SETSET(H, NAME, VALUE ) SET_PARAM property pair for Simulink object H.
5 % SETSET(N, NAME, VALUE ) SET_PARAM property pair on Simulink object named N.
6 % For Simulink models SETSET ignores Lock settings.
7 %
8 % See also SET, SET_PARAM.
9
10 % Copyright 1984-2005 The MathWorks, Inc.
11 % $Revision: 1.4.4.1 $
12
160 13 if isempty(h)
14 return
15 end
16
160 17 if ischar(h)
18 h = get_param(h,'handle');
19 end
20
21 %
22 % Tease out the HG handles and Simulink handles
23 % from the input handle vector - it might be a
24 % non-homogenous array (e.g, some HG, some Simulink)
25 % The resulting arrays will be processed separately
26 % below. Note that the Simulink handles are guarded
27 % so that we don't call Simulink when it's not necessary.
28 %
160 29 ishg = ishghandle(h);
160 30 hg = h(ishg);
160 31 if length(hg) ~= length(h),
32 issl = isslhandle(h);
33 sl = h(issl);
160 34 else
0.01 160 35 sl = [];
160 36 end
37
160 38 if ~isempty(hg)
160 39 if iscell(propValue)
40 %Vectorize SET not used because propValue may vary per object
41 values = propValue( logical(ishg) );
42 if length(hg) ~= length(values)
43 error('MATLAB:SETSET:InconsistentInputs',...
44 'Inconsistent number of objects and property values.')
45 end
46 for i = 1:length(hg)
47 set( hg(i), propName, values{i} )
48 end
160 49 else
160 50 set( hg, propName, propValue )
160 51 end
160 52 end
53
160 54 if ~isempty(sl)
55 %set_param can not be vectorized because of the Lock issue.
56 if iscell(propValue)
57 values = propValue( logical(issl) );
58 end
59 for i = 1:length(sl)
60 %If the block is a linked system, reassign the block so that
61 %we are actually setting the block's reference system
62 if ~strcmp(get_param(sl(i),'type'),'block_diagram')
63 if strcmp(get_param(sl(i),'LinkStatus'),'resolved')
64 sl(i) = get_param(get_param (sl(i),'ReferenceBlock'),'Handle');
65 end
66 end
67
68 r = bdroot( sl(i) );
69
70 LockSetting = get_param(r, 'Lock');
71 DirtySetting = get_param(r,'Dirty');
72
73 set_param( r , 'Lock', 'off');
74
75 if iscell(propValue)
76 set_param( sl(i), propName, values{i} );
77 else
78 set_param( sl(i), propName, propValue );
79 end
80
81 set_param( r, ...
82 'Lock' , LockSetting,...
83 'Dirty', DirtySetting);
84 end
85 end