This is a static copy of a profile reportHome
opaque.double (1 call, 0.000 sec)
Generated 15-Mar-2007 12:02:07 using real time.
M-function in file C:\Program Files\MATLAB71\toolbox\matlab\datatypes\@opaque\double.m
[Copy to new window for comparing multiple runs]
Parents (calling functions)
Function Name | Function Type | Calls |
clf | M-function | 1 |
Lines where the most time was spent
No measurable time spent in this functionLine Number | Code | Calls | Total Time | % Time | Time Plot |
14 | return; | 1 | 0 s | 0% |  |
13 | dbl = builtin('double', opaque... | 1 | 0 s | 0% |  |
12 | if ~isjava(opaque_array) | 1 | 0 s | 0% |  |
Other lines & overhead | | | 0 s | 0% |  |
Totals | | | 0.000 s | 0% | |
Children (called functions)
No childrenM-Lint results
Line number | Message |
60 | Use && instead of & as the AND operator in (scalar) conditional statements. |
Coverage results
[ Show coverage for parent directory ]
Total lines in file | 90 |
Non-code lines (comments, blank lines) | 34 |
Code lines (lines that can run) | 56 |
Code lines that did run | 3 |
Code lines that did not run | 53 |
Coverage (did run/can run) | 5.36 % |
Function listing
time calls line
1 function dbl = double(opaque_array)
2 %DOUBLE Convert a Java object to DOUBLE
3
4 % Chip Nylander, June 1998
5 % Copyright 1984-2002 The MathWorks, Inc.
6 % $Revision: 1.9 $ $Date: 2002/06/17 13:17:44 $
7
8 %
9 % For opaque types other than those programmed here, just run the default
10 % builtin double function.
11 %
1 12 if ~isjava(opaque_array)
1 13 dbl = builtin('double', opaque_array);
1 14 return;
15 end
16
17 %
18 % Convert opaque array to cell array to get the items in it.
19 %
20 err = 0;
21
22 try
23 cel = cell(opaque_array);
24 catch
25 err = 1;
26 end
27
28 if err
29 dbl = [];
30 return;
31 end
32
33 sz = builtin('size', cel);
34 psz = prod(sz);
35
36 %
37 % An empty Java array becomes an empty double array.
38 %
39 if psz == 0
40 try
41 dbl = reshape([],size(cel));
42 catch
43 dbl = [];
44 end
45 return;
46 end;
47
48 %
49 % A java.lang.Number array becomes a double array.
50 %
51 dbl = zeros(sz);
52 t = opaque_array(1);
53 c = class(t);
54
55 while ~isempty(findstr(c,'[]'))
56 t = t(1);
57 c = class(t);
58 end
59
60 if psz == 1 & isnumeric(t)
61 dbl = double(t);
62 return;
63 end
64
65 if isa(t,'java.lang.Number')
66 for i=1:psz
67 dbl(i) = cel{i};
68 end;
69 return;
70 end
71
72 %
73 % Run toDouble on each Java object in the MATLAB array. This will error
74 % out if a toDouble method is not available for the Java class of the object.
75 %
76 if psz == 1
77 if ~isjava(opaque_array(1))
78 dbl = builtin('double', opaque_array(1));
79 else
80 dbl = toDouble(opaque_array(1));
81 end
82 else
83 for i = 1:psz
84 if ~isjava(cel{i})
85 dbl(i) = toDouble(cel{i});
86 else
87 dbl(i) = toDouble(cel{i});
88 end;
89 end;
90 end;