0

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?

1 Answer 1

1

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);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.