Reputation: 151
I have a very large <1165900 x 1 cell> 'a' that I want to convert into datenum. I've done this somehow before but it has stopped working for me. Instead, I get the following error now:
Error using datenum (line 179)
DATENUM failed.
Caused by:
Error using dtstr2dtnummx
Failed on converting date string to date number.
I've just written this as the code:
b = datenum(a, 'dd.mm.yyyy HH.MM.SS.FFF');
Does anyone know what I've done wrong?
Upvotes: 0
Views: 2329
Reputation: 20309
The syntax into datenum
is correct, are you certain that a
is formatted correctly?
Here is some code I used to verify the syntax into datenum
was correct:
%define format string
fmt = 'dd.mm.yy HH.MM.SS';
%create dateString using current time
dStr = datestr(now, fmt);
%convert num to string with datenum
dNum = dateNum(dStr, fmt);
Upvotes: 1