Simple datenum question....I think? I just can't get it to work!
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!