function day is not working in matlab 2020a

1 Ansicht (letzte 30 Tage)
Prasanth R
Prasanth R am 21 Dez. 2020
Kommentiert: Ameer Hamza am 21 Dez. 2020
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'.

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 21 Dez. 2020
Function day() is defined for datetime input arguments. For example
>> t = datetime('now');
>> day(t)
ans =
21
  4 Kommentare
Prasanth R
Prasanth R am 21 Dez. 2020
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...
Ameer Hamza
Ameer Hamza am 21 Dez. 2020
I am glad to be of help!!!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by