This is a static copy of a profile report

Home

getpixelposition (Calls: 1, Time: 0.004 s)
Generated 18-May-2021 16:05:25 using performance time.
function in file /usr/local/MATLAB/R2021a/toolbox/matlab/uitools/getpixelposition.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
axis>LocSetEqualsubfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
37
position = matlab.ui.internal....
10.004 s96.6%
29
if ~ishghandle(h)
10.000 s1.6%
26
narginchk(1, 2);
10.000 s1.0%
34
recursive = false;
10.000 s0.2%
33
if nargin < 2
10.000 s0.1%
All other lines  0.000 s0.4%
Totals  0.004 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...PositionHelper.getPixelPositionHelperclass method10.002 s35.2%
Self time (built-ins, overhead, etc.)  0.003 s64.8%
Totals  0.004 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function37
Non-code lines (comments, blank lines)29
Code lines (lines that can run)8
Code lines that did run7
Code lines that did not run1
Coverage (did run/can run)87.50 %
Function listing
time 
Calls 
 line
   1 
function position = getpixelposition(h,recursive)
   2 
% GETPIXELPOSITION Get the position of an HG object in pixel units.
   3 
%   GETPIXELPOSITION(HANDLE) gets the position of the object specified by
   4 
%   HANDLE in pixel units.
   5 
%
   6 
%   GETPIXELPOSITION(HANDLE, RECURSIVE) gets the position as above. If
   7 
%   RECURSIVE is true, the returned position is relative to the parent
   8 
%   figure of HANDLE.
   9 
%
  10 
%   POSITION = GETPIXELPOSITION(...) returns the pixel position in POSITION.
  11 
%
  12 
%   Example:
  13 
%       f = figure;
  14 
%       p = uipanel('Position', [.2 .2 .6 .6]);
  15 
%       h1 = uicontrol(p, 'Units', 'normalized', 'Position', [.1 .1 .5 .2]);
  16 
%       % Get pixel position w.r.t the parent uipanel
  17 
%       pos1 = getpixelposition(h1)
  18 
%       % Get pixel position w.r.t the parent figure using the recursive flag
  19 
%       pos2 = getpixelposition(h1, true)
  20 
%
  21 
%   See also SETPIXELPOSITION, UICONTROL, UIPANEL
  22 

  23 
% Copyright 1984-2013 The MathWorks, Inc.
  24 

  25 
% Verify that getpixelposition is given between 1 and 2 arguments
< 0.001 
      1 
  26
narginchk(1, 2); 
  27 

  28 
% Verify that "h" is a handle
< 0.001 
      1 
  29
if ~ishghandle(h) 
  30 
    error(message('MATLAB:getpixelposition:InvalidHandle'))
< 0.001 
      1 
  31
end 
  32 

< 0.001 
      1 
  33
if nargin < 2 
< 0.001 
      1 
  34
    recursive = false; 
< 0.001 
      1 
  35
end 
  36 

  0.004 
      1 
  37
position = matlab.ui.internal.GetPixelPositionHelper.getPixelPositionHelper(h,recursive); 

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