MATLAB: Why isn´t datevec accepting strings like this one: “12-12-2012 00:00”

datedatevecstringtime

Hi guys,
I used datevec before but never with a string that points to midnight.
I have an array like this one:
01-06-2014 00:00,
01-06-2014 00:10,
01-06-2014 00:20,
01-06-2014 00:30,
01-06-2014 00:40,
02-06-2014 00:00,
02-06-2014 00:10,
02-06-2014 00:20,
02-06-2014 00:30,
02-06-2014 00:40]
the thing is: datevec doesn´t recognize any of the strings that have 00:00 and i don´t know why…
Does anyone know what to do?
Thanks is advance!
Inês

Best Answer

I do not seem to be able to reproduce your problem. Are you sure you are providing strings to datevec (as this is not the case in your example)
datevec({'01-06-2014 00:00', '01-06-2014 00:10', '01-06-2014 00:20',...
'01-06-2014 00:30', '01-06-2014 00:40', '02-06-2014 00:00',...
'02-06-2014 00:10', '02-06-2014 00:20', '02-06-2014 00:30', '02-06-2014 00:40'})
ans =
2014 1 6 0 0 0
2014 1 6 0 10 0
2014 1 6 0 20 0
2014 1 6 0 30 0
2014 1 6 0 40 0
2014 2 6 0 0 0
2014 2 6 0 10 0
2014 2 6 0 20 0
2014 2 6 0 30 0
2014 2 6 0 40 0