This is a static copy of a profile reportHome
findStartStop (1 call, 0.033 sec)
Generated 05-Aug-2011 13:03:53 using cpu time.
function in file /home/LeechJ/cbass_analysis/reduc/support/findStartStop.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 |
16 | f1 = find(ind(1:dataLength)==1... | 4 | 0.033 s | 100.0% |  |
32 | return; | 1 | 0 s | 0% |  |
28 | end | 4 | 0 s | 0% |  |
27 | end | 3 | 0 s | 0% |  |
26 | index = index+1; | 3 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.033 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
Line number | Message |
20 | The variable 'startIndex' appears to change size on every loop iteration. Consider preallocating for speed. |
24 | The variable 'stopIndex' appears to change size on every loop iteration. Consider preallocating for speed. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 32 |
Non-code lines (comments, blank lines) | 15 |
Code lines (lines that can run) | 17 |
Code lines that did run | 15 |
Code lines that did not run | 2 |
Coverage (did run/can run) | 88.24 % |
Function listing
time calls line
1 function [startIndex stopIndex] = findStartStop(ind)
2
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 %
5 % function [startIndex stopIndex] = findStartStop(ind)
6 %
7 % function to find the start and stop indices of the events in ind
8 %
9 % sjcm
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
1 12 f1 = 1;
1 13 index = 1;
1 14 dataLength = length(ind);
1 15 while(~isempty(f1))
0.03 4 16 f1 = find(ind(1:dataLength)==1,1);
4 17 f2 = find(ind(f1:dataLength)==0,1)+f1-2;
18
4 19 if(~isempty(f1))
3 20 startIndex(index) = f1;
3 21 if(isempty(f2))
22 f2 = dataLength;
23 end
3 24 stopIndex(index) = f2;
3 25 ind(f1:f2) = 0;
3 26 index = index+1;
3 27 end
4 28 end
29
30 % that's it.
31
1 32 return;