This is a static copy of a profile report

Home

Function details for isprop>hasPropThis is a static copy of a profile report

Home

isprop>hasProp (Calls: 2, Time: 0.002 s)
Generated 02-May-2020 21:54:31 using performance time.
subfunction in file /Applications/MATLAB_R2018a.app/toolbox/matlab/datatypes/isprop.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
ispropfunction2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
53
tf= ~isempty(p) && str...
20.000 s26.3%
52
p = findprop(obj, propName); %...
20.000 s15.5%
45
if isa(obj, 'double') % In cas...
20.000 s15.0%
44
if ( isa(obj, 'handle') || ~is...
20.000 s10.6%
61
end
20.000 s7.8%
All other lines  0.000 s24.7%
Totals  0.002 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function24
Non-code lines (comments, blank lines)1
Code lines (lines that can run)23
Code lines that did run7
Code lines that did not run16
Coverage (did run/can run)30.43 %
Function listing
time 
Calls 
 line
  42 
function tf = hasProp( obj, propName )
< 0.001 
      2 
  43
try 
< 0.001 
      2 
  44
    if ( isa(obj, 'handle') || ~isobject(obj) ) % COM is an example that returns FALSE from ISOBJECT but should go into this branch 
< 0.001 
      2 
  45
        if isa(obj, 'double') % In case the object is casted to double 
  46 
            obj = handle(obj);
  47 
            if ishghandle(obj) % graphics handle
  48 
                tf = isprop(obj, propName); % delegate to HG ISPROP overload
  49 
                return
  50 
            end
  51 
        end
< 0.001 
      2 
  52
        p = findprop(obj, propName); % match case sensitivity determined by the object's FINDPROP 
< 0.001 
      2 
  53
        tf= ~isempty(p) && strcmpi(p.Name,propName); % make sure property match to the complete query text 
  54 
    else % assume FINDPROP is not defined for OBJ and query METACLASS
  55 
        mc = metaclass(obj);
  56 
        if isempty(mc)  % no property
  57 
            tf = false;
  58 
        else
  59 
            tf = ~isempty( findobj(mc.PropertyList, '-depth',0,'Name', propName) );
  60 
        end
< 0.001 
      2 
  61
    end 
  62 
catch
  63 
    tf = false;
  64 
end
< 0.001 
      2 
  65
end 

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