Count Days in Months

40 ビュー (過去 30 日間)
BN
BN 2019 年 11 月 12 日
回答済み: Steven Lord 2019 年 11 月 12 日
Hey, I want to know the number of days of each month from 1982-01-01 to 2015-12-31.
I tried some codes from Matlab Help. till now I wrote this code:
t1 = datetime(1982,01,01); %start date
t2 = datetime(2015,12,31); %end date
T = t1:t2; %creating a range
no idea how to do it. in the end, I want to have one array (1*408)
thank you all

採用された回答

Steven Lord
Steven Lord 2019 年 11 月 12 日
The "Specify Step Size", "Compare Fixed-Length Duration and Calendar Duration Step Sizes", and "Dates and End of Month" sections on this documentation page will be of use to you as will the days function.

その他の回答 (2 件)

Nadir Altinbas
Nadir Altinbas 2019 年 11 月 12 日
why do not see this help topic
www.mathworks.com/help/matlab/ref/datetime.html

Neptune16
Neptune16 2019 年 11 月 12 日
you can try use this..
NumDays = daysdif('3/1/99', '3/1/00', 1)

カテゴリ

Help Center および File ExchangeCalendar についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by