This is a static copy of a profile report

Home

bwperim>ScalarToArray (18173 calls, 0.591 sec)
Generated 05-Nov-2014 07:53:52 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/images/images/bwperim.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
bwperimfunction18173
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
97
case 1
181730.080 s13.6%
96
switch conn
181730.080 s13.6%
95
if numel(conn) == 1
181730.070 s11.9%
101
conn_out = [0 1 0; 1 1 1; 0 1 ...
121150.060 s10.2%
104
conn_out = ones(3,3);
60580.040 s6.8%
All other lines  0.260 s44.1%
Totals  0.591 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function29
Non-code lines (comments, blank lines)9
Code lines (lines that can run)20
Code lines that did run7
Code lines that did not run13
Coverage (did run/can run)35.00 %
Function listing
   time   calls  line
93 function conn_out = ScalarToArray(conn)
94
0.07 18173 95 if numel(conn) == 1
0.08 18173 96 switch conn
0.08 18173 97 case 1
98 conn_out = 1;
99
0.04 18173 100 case 4
0.06 12115 101 conn_out = [0 1 0; 1 1 1; 0 1 0];
102
0.02 6058 103 case 8
0.04 6058 104 conn_out = ones(3,3);
105
106 case 6
107 conn_out = conndef(3,'minimal');
108
109 case 18
110 conn_out = cat(3,[0 1 0; 1 1 1; 0 1 0], ...
111 ones(3,3), [0 1 0; 1 1 1; 0 1 0]);
112
113 case 26
114 conn_out = conndef(3,'maximal');
115
116 otherwise
117 error(message('images:bwperim:unexpectedConnValue'));
118 end
119 else
120 conn_out = conn;
121 end