This is a static copy of a profile report

Home

isprop>hasProp (Calls: 52, Time: 0.009 s)
Generated 16-Jul-2020 17:09:25 using performance time.
subfunction in file /Applications/MATLAB_R2020a.app/toolbox/matlab/datatypes/isprop.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
ispropfunction52
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
53
tf= ~isempty(p) && str...
520.003 s26.6%
45
if isa(obj, 'double') % In cas...
520.002 s24.2%
52
p = findprop(obj, propName); %...
520.002 s22.4%
61
end
520.001 s7.6%
44
if ( isa(obj, 'handle') || ~is...
520.000 s3.5%
All other lines  0.001 s15.8%
Totals  0.009 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 run9
Code lines that did not run14
Coverage (did run/can run)39.13 %
Function listing
time 
Calls 
 line
  42 
function tf = hasProp( obj, propName )
< 0.001 
     52 
  43
    try 
< 0.001 
     52 
  44
        if ( isa(obj, 'handle') || ~isobject(obj) ) % COM is an example that returns FALSE from ISOBJECT but should go into this branch 
  0.002 
     52 
  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
< 0.001 
     52 
  51
            end 
  0.002 
     52 
  52
            p = findprop(obj, propName); % match case sensitivity determined by the object's FINDPROP 
  0.003 
     52 
  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 
     52 
  61
        end 
  62 
    catch
  63 
        tf = false;
< 0.001 
     52 
  64
    end 
< 0.001 
     52 
  65
end 

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