About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

scripts default iconDateStr2Num (Scripts) Publisher's description

DATESTR2NUM - Fast conversion of DATESTR to DATENUM

DATESTR2NUM - Fast conversion of DATESTR to DATENUM

The builtin DATENUM command is very powerful, but if the input is known to be valid and formatted exactly, a specific MEX can be much faster:
For single strings DateStr2Num takes <1% of the processing time of DATENUM (even with specified date format), for a {1 x 10000} cell string, DateStr2Num needs 0.17% to 2.7% of the DATENUM time. (Matlab 2009a, MSVC 2008 using SSE2 optimization).

D = DateStr2Num(S, F)
S: String or cell string in DATESTR(F) format.
In opposite to DATENUM the validity of the input string is *not* checked,
e.g. if month is in [1:12] and hour in [0:23].
F: Integer number defining the input format. Accepted:
0: 'dd-mmm-yyyy HH:MM:SS' 01-Mar-2000 15:45:17
1: 'dd-mmm-yyyy' 01-Mar-2000
29: 'yyyy-mm-dd' 2000-03-01
30: 'yyyymmddTHHMMSS' 20000301T154517
31: 'yyyy-mm-dd HH:MM:SS' 2000-03-01 15:45:17
300: 'yyyymmddTHHMMSS.FFF'

D: Serial date number.

C = {'2010-06-29 21:59:13', '2010-06-29 21:59:13'};
D = DateStr2Num(C, 31)
>> [734318.916122685, 734318.916122685]
Equivalent Matlab command (but a column vector is replied ever):
D = datenum(C, 'yyyy-mm-dd HH:MM:SS')

Precompiled Mex files: http://www.n-simon.de/mex

Tested: Matlab 6.5, 7.7, 7.8, 32bit, WinXP
Compiler: LCC 2.4/3.8, BCC 5.5, Open Watcom 1.8, MSVC 2008
Compatibility to MacOS, Linux, 64 bit is assumed, but not tested.

See also: DateConvert (Jan Simon)

System Requirements:

MATLAB 7.8 (R2009a)
Program Release Status: New Release
Program Install Support: Install and Uninstall

DateStr2Num (Scripts) Tags:

Click on a tag to find related softwares

Is DateStr2Num (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.