Problem with function "datenum"

Hello all,
I use a script where datenum is used, but it works randomly:
>> datenum('17:54:24.752','HH:MM:SS.FFF')
??? Error using ==> datenum at 174
DATENUM failed.
Caused by:
Error using ==> dtstr2dtnummx
Failed on converting date string to date number.
>> datenum('17:54:24.752','HH:MM:SS.FFF')
ans =
7.3597e+005
What could cause that? The date format was used planty of times before.

댓글 수: 2

per isakson
per isakson 2015년 10월 13일
편집: per isakson 2015년 10월 13일
Most likely the problem is caused by an erroneous value of an input argument. See Debug a MATLAB Program
Stephen23
Stephen23 2015년 10월 13일
Could there be non-printing characters in the string? These often pop up in online sourced data or from spreadsheets, and could easily cause an error without being visible themselves.

답변 (1개)

Peter Perkins
Peter Perkins 2015년 10월 13일
편집: Peter Perkins 2015년 10월 13일

0 개 추천

What version/platform of MATLAB is this? This sounds like a bug that was fixed in R2013a.
The bug report includes a patch for earlier versions.

댓글 수: 3

Eveline B
Eveline B 2015년 10월 14일
편집: Eveline B 2015년 10월 15일
MATLAB 2009a Do you know how I can find that patch?
Peter Perkins
Peter Perkins 2015년 10월 16일
Click on the bug report I linked to.
Walter Roberson
Walter Roberson 2015년 10월 16일
Unfortunately the bug report does not appear to include patches for R2009a or R2009b.

이 질문은 마감되었습니다.

질문:

2015년 10월 13일

마감:

2021년 8월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by