Error using datetime/datenum

조회 수: 10 (최근 30일)
Selim Khan
Selim Khan 2021년 1월 13일
댓글: Selim Khan 2021년 1월 13일
Hello,
Could anyone help me finding the error in my datenum command as shown below and with the screenshot?
>> dataset.date=datenum(dataset.date,'yyyy-mm-dd');
Error using datetime/datenum; Too many input arguments.
Thanks in advance,
Selim

답변 (1개)

Cris LaPierre
Cris LaPierre 2021년 1월 13일
First problem is you are trying to convert your datetime to a datenum. I hightly recommend keeping it a datetime. What are you trying to do that you want a datenum for?
Second, dataset.date is a datetime, not a string. You have too many input arguments because the formatIn input is only valid if your dates are strings. Remove this setting and your code should work.
  댓글 수: 1
Selim Khan
Selim Khan 2021년 1월 13일
Hi Cris,
Thanks for your kind reponse. Yes, it worked without converting to datenum. Regards, Selim

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Time Series Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by