Error using datetime/datenum

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

0 个投票

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 个评论

Hi Cris,
Thanks for your kind reponse. Yes, it worked without converting to datenum. Regards, Selim

请先登录,再进行评论。

类别

帮助中心File 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