This is a static copy of a profile report

Home

opaque.double (4982 calls, 0.197 sec)
Generated 05-Aug-2011 13:02:24 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/datatypes/@opaque/double.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
clffunction10
subplot>createListenerssubfunction1084
subplot>axesDestroyedsubfunction155
scribe.legend.legendfunction112
scribe.legend.methods>getsizeinfosubfunction143
scribe.legend.methods>strsizesubfunction491
...be.legend.methods>create_legend_itemssubfunction220
scribe.legend.initfunction154
...nd.methods>create_plotchild_listenerssubfunction55
scribe/private/updateLegendMenuToolbarfunction81
legendcolorbarlayout>localValidateListssubfunction507
legendcolorbarlayout>validateTextObjectssubfunction165
scribe.legend.init>computePossubfunction275
scribe.legend.init>changedPossubfunction118
scribe.legend.methods>update_userdatasubfunction112
legend>make_legendsubfunction14
legendcolorbarlayout>doLayoutCBsubfunction882
legendcolorbarlayout>localChangePositionsubfunction33
legendcolorbarlayout>doParentResizesubfunction58
legendcolorbarlayout>doPixelBoundsCBsubfunction28
scribe.legend.init>PlotAxesDeletedsubfunction20
scribe.legend.init>legendDeletedsubfunction76
scribe.legend.methods>get_best_locationsubfunction18
legendcolorbarlayout>doInOutLayoutsubfunction72
scribe.legend.init>setWidthHeightsubfunction81
scribe.legend.init>changedCurrentAxessubfunction6
...nd.init>PlotAxesChangedFontPropertiessubfunction12
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
13
dbl = builtin('double', opaque...
49820.087 s44.4%
12
if ~isjava(opaque_array)
49820.055 s27.8%
14
return;
49820.011 s5.6%
All other lines  0.044 s22.2%
Totals  0.197 s100% 
Children (called functions)
No children
Code Analyzer results
Line numberMessage
38Best practice is for CATCH to be followed by an identifier that gets the error information.
51FINDSTR will be removed in a future release. Use STRFIND instead.
Coverage results
[ Show coverage for parent directory ]
Total lines in function90
Non-code lines (comments, blank lines)34
Code lines (lines that can run)56
Code lines that did run3
Code lines that did not run53
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-2007 The MathWorks, Inc.
6 % $Revision: 1.9.4.5 $ $Date: 2007/12/06 13:29:42 $
7
8 %
9 % For opaque types other than those programmed here, just run the default
10 % builtin double function.
11 %
0.05 4982 12 if ~isjava(opaque_array)
0.09 4982 13 dbl = builtin('double', opaque_array);
0.01 4982 14 return;
15 end
16
17 %
18 % Convert opaque array to cell array to get the items in it.
19 %
20
21 try
22 cel = cell(opaque_array);
23 catch exception %#ok
24 dbl = [];
25 return;
26 end
27
28
29 sz = builtin('size', cel);
30 psz = prod(sz);
31
32 %
33 % An empty Java array becomes an empty double array.
34 %
35 if psz == 0
36 try
37 dbl = reshape([],size(cel));
38 catch
39 dbl = [];
40 end
41 return;
42 end;
43
44 %
45 % A java.lang.Number array becomes a double array.
46 %
47 dbl = zeros(sz);
48 t = opaque_array(1);
49 c = class(t);
50
51 while ~isempty(findstr(c,'[]'))
52 t = t(1);
53 c = class(t);
54 end
55
56 if psz == 1 && isnumeric(t)
57 dbl = double(t);
58 return;
59 end
60
61 if isa(t,'java.lang.Number')
62 for i=1:psz
63 if isa(cel{i}, 'java.lang.Object')
64 dbl(i) = doubleValue(cel{i});
65 else
66 dbl(i) = cel{i};
67 end
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;