This is a static copy of a profile reportHome
isprop (22979 calls, 3.552 sec)
Generated 05-Aug-2011 13:02:40 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/datatypes/isprop.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
41 | valid = ~isempty(p) &&... | 22136 | 0.634 s | 17.8% |  |
40 | p=findprop(varargin{1}, vararg... | 22216 | 0.459 s | 12.9% |  |
32 | elseif isa(varargin{1}, 'doubl... | 22979 | 0.361 s | 10.2% |  |
18 | valid = false(size(varargin{1}... | 22979 | 0.350 s | 9.8% |  |
13 | if (isempty(varargin{1})) | 22979 | 0.350 s | 9.8% |  |
All other lines | | | 1.399 s | 39.4% |  |
Totals | | | 3.552 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 59 |
Non-code lines (comments, blank lines) | 13 |
Code lines (lines that can run) | 46 |
Code lines that did run | 26 |
Code lines that did not run | 20 |
Coverage (did run/can run) | 56.52 % |
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-2010 The MathWorks, Inc.
8
0.08 22979 9 try
0.17 22979 10 switch nargin
0.08 22979 11 case 2
12 % ISPROP for hg or object instances
0.35 22979 13 if (isempty(varargin{1}))
14 valid = false;
15 return;
16 end
17
0.35 22979 18 valid = false(size(varargin{1}));
0.28 22979 19 if(isobject(varargin{1}) && ~isa(varargin{1}, 'handle'))
20 if numel(varargin{1}) == 1
21 % treat scalar separately to avoid overloaded subsref issues
22 valid = hasProp(varargin{1}, varargin{2});
23 else
24 for i = 1:numel(varargin{1})
25 try
26 valid(i) = hasProp(varargin{1}(i), varargin{2});
27 catch e %#ok<NASGU>
28 valid(i) = false;
29 end
30 end
31 end
0.36 22979 32 elseif isa(varargin{1}, 'double')
759 33 for i = 1:numel(varargin{1})
0.09 759 34 p=findprop(handle(varargin{1}(i)), varargin{2});
0.01 759 35 valid(i) = ~isempty(p) && strcmpi(p.Name,varargin{2});
759 36 end
0.03 22220 37 else
0.26 22220 38 if numel(varargin{1}) == 1
39 % treat scalar separately to avoid overloaded subsref issues
0.46 22216 40 p=findprop(varargin{1}, varargin{2});
0.63 22136 41 valid = ~isempty(p) && strcmpi(p.Name,varargin{2});
4 42 else
4 43 for i = 1:numel(varargin{1})
12 44 p=findprop(varargin{1}(i), varargin{2});
12 45 valid(i) = ~isempty(p) && strcmpi(p.Name,varargin{2});
12 46 end
4 47 end
0.09 22140 48 end
49 case 3
50 % ISPROP for class - package and class name
51 p=findprop(findclass(findpackage(varargin{1}),varargin{2}),varargin{3});
52 valid = ~isempty(p) && strcmpi(p.Name,varargin{3});
53 otherwise
54 valid = false;
55 end
80 56 catch e %#ok<NASGU>
80 57 valid = false;
80 58 end
0.09 22979 59 end
Other subfunctions in this file are not included in this listing.