This is a static copy of a profile report

Home

tstr2date (10 calls, 0.022 sec)
Generated 05-Aug-2011 13:00:29 using cpu time.
function in file /home/LeechJ/cbass_analysis/matutils/dateconv/tstr2date.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
tstr2mjdfunction10
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
39
if (dif)
100.011 s50.0%
35
end
600.011 s50.0%
50
t.sec=c{6};
100 s0%
49
t.min=c{5};
100 s0%
48
t.hour=c{4};
100 s0%
All other lines  0 s0%
Totals  0.022 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
str2numfunction500 s0%
Self time (built-ins, overhead, etc.)  0.022 s100.0%
Totals  0.022 s100% 
Code Analyzer results
Line numberMessage
19To improve performance, use logical indexing instead of FIND.
30The variable 'c' appears to change size on every loop iteration. Consider preallocating for speed.
31The variable 'c' appears to change size on every loop iteration. Consider preallocating for speed.
33The variable 'c' appears to change size on every loop iteration. Consider preallocating for speed.
33STR2DOUBLE is faster than STR2NUM; however, STR2DOUBLE operates only on scalars. Use the function that best suits your needs.
41The variable 'c' appears to change size on every loop iteration. Consider preallocating for speed.
Coverage results
[ Show coverage for parent directory ]
Total lines in function50
Non-code lines (comments, blank lines)22
Code lines (lines that can run)28
Code lines that did run22
Code lines that did not run6
Coverage (did run/can run)78.57 %
Function listing
   time   calls  line
1 function t=tstr2date(time)
2
3 % function t=tstr2date(time)
4 %
5 % input time in sza string format, ie 12-JUN-05:12:12:12
6 % and returns struct t:
7 %
8 % t.day=12;
9 % t.month='JUN';
10 % t.year=5;
11 % t.hour=12;
12 % t.min=12;
13 % t.sec=12;
14 %
15 % Michael Loh
16
17 % find all "-' and replace with ':'
10 18 f=find(time=='-');
10 19 time(f)=':';
20
10 21 f=find(time==':');
22
10 23 if (length(f)<4)
24 error('Invalid time')
25 end
26
10 27 f=[0 f length(time)+1];
10 28 for i=2:length(f)
60 29 if (i==3)
10 30 c{i-1}=time(f(2)+1:f(3)-1);
10 31 c{i-1}=upper(c{i-1});
50 32 else
50 33 c{i-1}=str2num(time(f(i-1)+1:f(i)-1));
50 34 end
0.01 60 35 end
36
10 37 cnt=length(c);
10 38 dif=6-cnt;
0.01 10 39 if (dif)
40 for i=1:dif
41 c{cnt+i}=0;
42 end
43 end
44
10 45 t.day=c{1};
10 46 t.month=c{2};
10 47 t.year=c{3};
10 48 t.hour=c{4};
10 49 t.min=c{5};
10 50 t.sec=c{6};