Hi all, I'm a bit of a newbie with Matlab so please forgive if this seems a bit basic.
My problem is as follows. I have a string called timestamp which contains a date and a time, e.g. 2009.01.01 00:30. I need to remove the time reading (00:30) and convert the date into a number using the datenum function. I have tried to do this using the following code:
datestamp = identifier.timestamp(1:10) % Removes the time to give only the date
datestamp2 = strrep(datestamp,'.', ',') % Replaces . with , to allow parsing
datestamp3 = datenum(datestamp2) % Should give a number for the date
For some reason this code returns the error,"Error using ==> datevec. 2009 is too large to be a month".
I am obviously doing this the wrong way, but how can I get this to work?
All help is massively appreciated. Thanks.
Red Beard
Best Answer