Invalid default value for property 'MonthsOfYear' in class 'datetime'
이전 댓글 표시
The datetime function has recently started giving me the following error, and I can't figure out what the problem might be. Even code that previously worked without problem is now broken. I've tried deleting and re-installing Matlab, but nothing has helped. Needless to say, all functions that depend on datetime are also broken.
If anyone could offer any suggestions it would be appreciated.

댓글 수: 6
Walter Roberson
2018년 11월 19일
experiment with using
restoredefaultpath; rehash toolboxcache
dpb
2018년 11월 19일
Which release?
What does
which datetime
return?
Sounds like something has gotten munged, somehow.
Eugene Larsen-Hallock
2018년 11월 19일
편집: Eugene Larsen-Hallock
2018년 11월 19일
dpb
2018년 11월 19일
Ah, yes! There are many possible default settings one could fool with...would be interesting to see what the content of that settings.m file might have contained. I suppose for special purposes there might be reasons to fiddle with some of the internals, but perhaps it was just somebody trying to be too clever by half, maybe??
Eugene Larsen-Hallock
2018년 11월 19일
편집: Eugene Larsen-Hallock
2018년 11월 19일
dpb
2018년 11월 19일
Ah, yes. That way would alias the builtin _settings.m_
>> which settings
C:\...\toolbox\matlab\configtools\settings.m
>>
which would really wreak havoc I can see. One generally doesn't think of such things altho there are documented ways to set particular preferences, when one tries to get too clever or stumbles over a naming conflict unawares, bad things are easily caused to happen.
Glad to know what the real deal turned out to be and not difficult to solve once uncovered...also something to file away in the "strange symptom what to look for" column.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!