This is a static copy of a profile reportHome
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 Name | Function Type | Calls |
bwperim | function | 18173 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
97 | case 1 | 18173 | 0.080 s | 13.6% |  |
96 | switch conn | 18173 | 0.080 s | 13.6% |  |
95 | if numel(conn) == 1 | 18173 | 0.070 s | 11.9% |  |
101 | conn_out = [0 1 0; 1 1 1; 0 1 ... | 12115 | 0.060 s | 10.2% |  |
104 | conn_out = ones(3,3); | 6058 | 0.040 s | 6.8% |  |
All other lines | | | 0.260 s | 44.1% |  |
Totals | | | 0.591 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 29 |
Non-code lines (comments, blank lines) | 9 |
Code lines (lines that can run) | 20 |
Code lines that did run | 7 |
Code lines that did not run | 13 |
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