This is a static copy of a profile report

Home

findspaces (3 calls, 0.011 sec)
Generated 05-Aug-2011 13:01:16 using cpu time.
function in file /home/LeechJ/cbass_analysis/matutils/findspaces.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
readScript>getSingleStrValsubfunction2
readScript>getstrvalsubfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
17
f=regexpi(lin,' ');
30.011 s100.0%
29
end
400 s0%
28
end
200 s0%
27
j=j+1;
200 s0%
26
list{j}=str;
200 s0%
All other lines  0 s0%
Totals  0.011 s100% 
Children (called functions)
No children
Code Analyzer results
Line numberMessage
26The variable 'list' appears to change size on every loop iteration. Consider preallocating for speed.
Coverage results
[ Show coverage for parent directory ]
Total lines in function29
Non-code lines (comments, blank lines)17
Code lines (lines that can run)12
Code lines that did run12
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
   time   calls  line
1 function list=findspaces(lin)
2
3 % function list=findspaces(lin)
4 %
5 % extracts elements of string, lin, ignoring multiple spaces.
6 %
7 % Example:
8 % str='you are dumb';
9 %
10 % list{1}='you'
11 % list{2}='are'
12 % list{3}='dumb'
13 %
14 % Michael Loh
15
16 % find spaces
0.01 3 17 f=regexpi(lin,' ');
3 18 f(end+1)=length(lin);
3 19 f(end+1)=1;
3 20 f=[f(end) f(1:end-1)];
21
3 22 j=1;
3 23 for i=2:length(f)
40 24 str=sscanf(lin(f(i-1):f(i)),'%s');
40 25 if (~isempty(str))
20 26 list{j}=str;
20 27 j=j+1;
20 28 end
40 29 end

Other subfunctions in this file are not included in this listing.