This is a static copy of a profile reportHome
tstr2mjd (10 calls, 0.055 sec)
Generated 05-Aug-2011 13:00:30 using cpu time.
function in file /home/LeechJ/cbass_analysis/matutils/dateconv/tstr2mjd.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 |
18 | t=tstr2date(tstr(m,:)); | 10 | 0.033 s | 60.0% |  |
24 | mjd(m,1)=date2mjd(t.year,t.mon... | 10 | 0.022 s | 40.0% |  |
28 | return | 10 | 0 s | 0% |  |
26 | end | 10 | 0 s | 0% |  |
25 | end | 10 | 0 s | 0% |  |
All other lines | | | 0.000 s | 0.0% |  |
Totals | | | 0.055 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
tstr2date | function | 10 | 0.022 s | 40.0% |  |
date2mjd | function | 10 | 0.011 s | 20.0% |  |
monthStr2num | function | 10 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.022 s | 40.0% |  |
Totals | | | 0.055 s | 100% | |
Code Analyzer results
Line number | Message |
15 | The variable 'mjd' appears to change size on every loop iteration. Consider preallocating for speed. |
24 | The variable 'mjd' appears to change size on every loop iteration. Consider preallocating for speed. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 28 |
Non-code lines (comments, blank lines) | 17 |
Code lines (lines that can run) | 11 |
Code lines that did run | 10 |
Code lines that did not run | 1 |
Coverage (did run/can run) | 90.91 % |
Function listing
time calls line
1 function mjd=tstr2mjd(tstr)
2
3 %mjd=tstr2mjd(tstr)
4 %
5 %Converts a SZA-standard UTC time string to mjd
6 %
7 %mjd=tstr2mjd('12-jun-2005:00:00:00')
8
9 % do in a loop if more than one time
10 10 l = size(tstr,1);
11
10 12 for m=1:l
10 13 if(isempty(strfind(tstr(m,:), '-')))
14 % time is blank
15 mjd(m,:) = 0;
10 16 else
17 %Separate units os string into fields of time structure t
0.03 10 18 t=tstr2date(tstr(m,:));
19
20 %Convert month string to integer
10 21 t=monthStr2num(t);
22
23 %Find mjd
0.02 10 24 mjd(m,1)=date2mjd(t.year,t.month,t.day,t.hour,t.min,t.sec);
10 25 end
10 26 end
27
10 28 return