This is a static copy of a profile report

Home

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)

Function NameFunction TypeCalls
calculateTaufunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
16
f1 = find(ind(1:dataLength)==1...
40.033 s100.0%
32
return;
10 s0%
28
end
40 s0%
27
end
30 s0%
26
index = index+1;
30 s0%
All other lines  0 s0%
Totals  0.033 s100% 
Children (called functions)
No children
Code Analyzer results
Line numberMessage
20The variable 'startIndex' appears to change size on every loop iteration. Consider preallocating for speed.
24The variable 'stopIndex' appears to change size on every loop iteration. Consider preallocating for speed.
Coverage results
[ Show coverage for parent directory ]
Total lines in function32
Non-code lines (comments, blank lines)15
Code lines (lines that can run)17
Code lines that did run15
Code lines that did not run2
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;