This is a static copy of a profile reportHome
flagEndpoints (2 calls, 0.044 sec)
Generated 05-Aug-2011 13:03:53 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/flagEndpoints.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 |
10 | delta=f(1,2:n)-f(1,1:n-1); | 2 | 0.022 s | 50.0% |  |
12 | down=find(delta==-1); | 2 | 0.011 s | 25.0% |  |
11 | up=find(delta==1); | 2 | 0.011 s | 25.0% |  |
25 | end | 2 | 0 s | 0% |  |
24 | indices=transpose([up;down]); | 2 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.044 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 25 |
Non-code lines (comments, blank lines) | 11 |
Code lines (lines that can run) | 14 |
Code lines that did run | 14 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
1 function indices=flagEndpoints(flags)
2 %%%%%%%%%%%%%%%%%%%%
3 %
4 % Given a logical array, find the indices of
5 % the starts and ends of cunks of ones.
6 %
7 %%%%%%%%%%%%%%%%%%%%
2 8 n=length(flags);
2 9 f=reshape(flags,1,n);
0.02 2 10 delta=f(1,2:n)-f(1,1:n-1);
0.01 2 11 up=find(delta==1);
0.01 2 12 down=find(delta==-1);
13
14 %Handle edge effects if the first or last
15 %flag indicates a noise event.
2 16 if (f(1)==1)
1 17 up = [0 up];
1 18 end
2 19 up=up+1;
2 20 if (f(n)==1)
1 21 down=[down n];
1 22 end
23
2 24 indices=transpose([up;down]);
2 25 end