This is a static copy of a profile report

Home

Function details for ispropThis is a static copy of a profile report

Home

isprop (Calls: 2, Time: 0.004 s)
Generated 02-May-2020 21:54:31 using performance time.
function 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
graphics/private/printjobContentChangesfunction2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
23
valid = hasProp(objQueried, pr...
20.002 s54.9%
16
valid = false(size(objQueried)...
20.000 s10.8%
22
if numel(objQueried) == 1
20.000 s5.9%
14
case 2
20.000 s5.8%
10
objQueried = varargin{1};
20.000 s4.6%
All other lines  0.001 s17.9%
Totals  0.004 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
isprop>hasPropsubfunction20.002 s46.6%
Self time (built-ins, overhead, etc.)  0.002 s53.4%
Totals  0.004 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function40
Non-code lines (comments, blank lines)11
Code lines (lines that can run)29
Code lines that did run11
Code lines that did not run18
Coverage (did run/can run)37.93 %
Function listing
time 
Calls 
 line
   1 
function valid = isprop(varargin)
   2 
%ISPROP Returns true if the property exists.
   3 
%   V = ISPROP(H, PROP) Returns true if PROP is a property of H.
   4 
%   V is a logical array of the same size as H.  Each true element of V
   5 
%   corresponds to an element of H that has the property PROP.
   6 

   7 
%   Copyright 1988-2016 The MathWorks, Inc.
   8 

< 0.001 
      2 
   9
narginchk(2,3); 
< 0.001 
      2 
  10
objQueried = varargin{1}; 
< 0.001 
      2 
  11
propName = varargin{2}; 
  12 

< 0.001 
      2 
  13
switch nargin 
< 0.001 
      2 
  14
    case 2 
< 0.001 
      2 
  15
        try % size may be overloaded by the object and lead to error here 
< 0.001 
      2 
  16
            valid = false(size(objQueried)); 
  17 
        catch % return FALSE when SIZE is overloaded to not return numbers
  18 
            valid = false;
  19 
            return;
  20 
        end
  21 
        
< 0.001 
      2 
  22
        if numel(objQueried) == 1 
  0.002 
      2 
  23
            valid = hasProp(objQueried, propName); 
  24 
        else
  25 
            % Use for-loop: input may not support ARRAYFUN (e.g. function_handle)
  26 
            for i = 1:numel(objQueried)
  27 
                valid(i) = hasProp(objQueried(i), propName);
  28 
            end
< 0.001 
      2 
  29
        end 
  30 
    case 3 % ISPROP for class - package and class name
  31 
        try
  32 
            p = findprop(findclass(findpackage(objQueried),propName),varargin{3});
  33 
            valid = ~isempty(p) && strcmpi(p.Name,varargin{3});
  34 
        catch
  35 
            valid = false;
  36 
        end
  37 
    otherwise
  38 
        assert(false); % Number of inputs should only be the above values
  39 
end
< 0.001 
      2 
  40
end 

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