フィルターのクリア

Strange behaviour of datenum function (Error using ==> dtstr2dtnummx)

7 ビュー (過去 30 日間)
Alizee
Alizee 2013 年 7 月 19 日
回答済み: Amit 2014 年 7 月 22 日
Hello,
I am using the datenum function (in the right way I hope!) and it is exhibiting a very weird behaviour when used in the debugger mode.
1) I tried the following while trying to debug my code:
K>> datenum('130624', 'yymmdd')
ans =
735409
K>> n=datenum('130624', 'yymmdd')
??? Error using ==> datenum at 182 DATENUM failed.
Caused by:
Error using ==> dtstr2dtnummx
Failed on converting date string to date number.
2) Then I exited the debugger mode and tried again the command window and no problem this time.
>> datenum('130624', 'yymmdd')
ans =
735409
>> n=datenum('130624', 'yymmdd')
n =
735409
3) I tried again in the debugger mode (not changing anything, just re-running the code until the breakpoint and it failed again but the other way around!
K>> datenum('130624', 'yymmdd')
??? Error using ==> datenum at 182 DATENUM failed.
Caused by:
Error using ==> dtstr2dtnummx
Failed on converting date string to date number.
K>> n=datenum('130624', 'yymmdd')
n =
735409
Does anybody have any idea why that is? If I run my program without breakpoint, the datenum function sometimes works and sometimes crashes it all seems very random. I am sure I can find a way around it but I am intrigued by this bug if anyone can explain it to me.
Thanks
Alizee
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 7 月 19 日
post your code
Sean de Wolski
Sean de Wolski 2013 年 7 月 19 日
Contact Technical Support.

サインインしてコメントする。

回答 (1 件)

Amit
Amit 2014 年 7 月 22 日
>> main_file Error using datenum (line 179) DATENUM failed.
Error in ReadACC (line 15) ACC_date_num(i) = datenum(char(ACC_date_chars),'dd.mm.yyyy');
Error in main_file (line 2) [ACC_date_time,ACC_price] = ReadACC('D:\Data_file.xlk');
Caused by: Error using dtstr2dtnummx Failed on converting date string to date number.
I tried uploading this file and this was the error i got

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by