Month function doesn't work with double anymore

3 ビュー (過去 30 日間)
Eric Escoto
Eric Escoto 2019 年 3 月 27 日
コメント済み: Star Strider 2019 年 3 月 27 日
Hello,
I have just updated to 2019a. My scripts have worked previously 2018 version and now they do not. I am recieving an error message,
"Undefined function 'month' for input arguments of type 'double'." I have not made any changes to my scripts between matlab software version change.
Any idea what is happening?
Thanks,
Eric

採用された回答

Star Strider
Star Strider 2019 年 3 月 27 日
From the documentation:
m = month(t) returns the month numbers of the datetime values in t. The m output contains integer values from 1 to 12.’
It appears only to work with datetime variables.
  2 件のコメント
Eric Escoto
Eric Escoto 2019 年 3 月 27 日
Star,
I worked around by calling the datevec associated with the double array. Works perfectly now.
Thanks for the quick response!
-Eric
Star Strider
Star Strider 2019 年 3 月 27 日
As always, my pleasure!
I was going to suggest using datevec if you’re working with datenum format variables.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by