function day is not working in matlab 2020a

2 次查看(过去 30 天)
I got the following error while using the function 'day' in matlab 2020a. But its worked in 2016a
>>t =
7.3652e+05
>> day(t)
Check for missing argument or incorrect argument data type in call to function 'day'.

采纳的回答

Ameer Hamza
Ameer Hamza 2020-12-21
Function day() is defined for datetime input arguments. For example
>> t = datetime('now');
>> day(t)
ans =
21
  4 个评论
Prasanth R
Prasanth R 2020-12-21
Issue solved. I removed the line
tint = int64(tt);
and used 'datenum' in datetime function
(tt= my matrix)
tdate = datetime(tt,'ConvertFrom','datenum') ;
day_count = day(tdate,'dayofmonth') ;
Thanks for your valuable time and consideration...

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by