This is a static copy of a profile report

Home

Function details for graphics/private/modifyUnitsForPrint>getObjWithUnitsThis is a static copy of a profile report

Home

graphics/private/modifyUnitsForPrint>getObjWithUnits (Calls: 1, Time: 0.016 s)
Generated 02-May-2020 21:54:30 using performance time.
subfunction in file /Applications/MATLAB_R2018a.app/toolbox/matlab/graphics/private/modifyUnitsForPrint.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
graphics/private/modifyUnitsForPrintfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
179
objWithUnits = findall(h, 'fla...
50.006 s39.4%
183
objUnitsModified.(units{unitsI...
50.004 s22.2%
192
cellfun(@(ph) getPropMode(ph, ...
50.001 s7.9%
194
cellfun(@(ph) getPropMode(ph, ...
50.001 s7.1%
182
handles = objWithUnits(~ishgha...
50.001 s5.4%
All other lines  0.003 s18.1%
Totals  0.016 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
findallfunction50.005 s28.3%
num2cellfunction50.002 s11.9%
Self time (built-ins, overhead, etc.)  0.010 s59.9%
Totals  0.016 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function25
Non-code lines (comments, blank lines)12
Code lines (lines that can run)13
Code lines that did run13
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
time 
Calls 
 line
 173 
function objUnitsModified = getObjWithUnits(h, unitsProp, units)
 174 

 175 
% Returns an array of objects which have the unitsProp property
 176 
% value set to the specified units.
< 0.001 
      1 
 177
saveProp = lower(unitsProp); 
< 0.001 
      1 
 178
for unitsIdx = 1:length(units) 
  0.006 
      5 
 179
    objWithUnits = findall(h, 'flat', unitsProp, units{unitsIdx}, '-property', 'Position'); 
 180 
    
 181 
    % Don't include the figure itself in this list
< 0.001 
      5 
 182
    handles = objWithUnits(~ishghandle(objWithUnits, 'figure')); 
  0.004 
      5 
 183
    objUnitsModified.(units{unitsIdx}).handles = num2cell(handles); 
 184 
    
 185 
    % The get command returns a cell array when passed multiple
 186 
    % handles. To keep the code simple downstream, wrap the single
 187 
    % handle result in a cell array too.
  0.001 
      5 
 188
    objUnitsModified.(units{unitsIdx}).positions = cellfun(@(ph)get(ph, 'Position'), ... 
      5 
 189
        objUnitsModified.(units{unitsIdx}).handles, 'UniformOutput', false); 
 190 
    % also store positionmode and unitsmode prop values
  0.001 
      5 
 191
    objUnitsModified.(units{unitsIdx}).positionmode = ... 
      5 
 192
        cellfun(@(ph) getPropMode(ph, 'Position'), objUnitsModified.(units{unitsIdx}).handles, 'UniformOutput', false); 
  0.001 
      5 
 193
    objUnitsModified.(units{unitsIdx}).([saveProp 'mode']) = ... 
      5 
 194
        cellfun(@(ph) getPropMode(ph, unitsProp), objUnitsModified.(units{unitsIdx}).handles, 'UniformOutput', false); 
< 0.001 
      5 
 195
end 
 196 

< 0.001 
      1 
 197
end 

Other subfunctions in this file are not included in this listing.