From: Jan Simon on 30 Jun 2010 10:37 Dear Pasan, > for a datetime cell array of 602870 elements, > dt_numbers=cellfun(@(x)datenum(x,'yyyy-mm-dd HH:MM:SS'),dt_strings); > 365 s > > dt_numbers=datenum(dt_strings,'yyyy-mm-dd HH:MM:SS'); > 4.1 s The first version of the C-mex is on the FEX, but the included test function uses the wrong syntax for the calls of DATENUM. Therefore the time comparison is not fair: http://www.mathworks.com/matlabcentral/fileexchange/28069 I've sent update some minutes ago. The computation is further 5% faster, because more integer operations as used. Finally DateStr2Num needs about 0.95% of the time spent by DATENUM for strings, and 1.8% to 4.2% for {1 x 10000} cell strings - for 2009a. Perhaps this helps. Are you familiar with compiling Mex functions? Jan
From: Jan Simon on 1 Jul 2010 06:16 Dear readers, Sorry, the above mention link is currently not working: > ...fileexchange/28069 Please wait, Jan
From: Jan Simon on 1 Jul 2010 12:36 Dear readers, > Sorry, the above mention link is currently not working: > > ...fileexchange/28069 DateStr2Num as Mex can be found now: http://www.mathworks.com/matlabcentral/fileexchange/28093 Jan
First
|
Prev
|
Pages: 1 2 3 Prev: Find loop within vector Next: export uitable selected cells in matlab |