creating year, month, day in month, hours in a day and minutes in that hour MATRIX for any year (e.g 2016)
5 次查看(过去 30 天)
显示 更早的评论
I want to create a matrix of 525600x5 in which i want first column year, second column month in year, third column day in a month, fourth column hour in a day, and fifth minute in an hour..
viz. 2016 1 0 0 0 1
2016 1 0 0 0 2
.
.
.
.
.2016 12 31 23 60
2 个评论
Stephen23
2021-3-7
2016 was a leap year, so it actually had:
366 * 24 * 60 % minutes
not 525600 as you wrote.
采纳的回答
Stephen23
2021-3-7
T1 = datetime(2016,1,1,0,0,0);
T2 = datetime(2017,1,1,0,0,0)-minutes(0.5);
V = (T1:minutes(1):T2).';
M = [V.Year,V.Month,V.Day,V.Hour,V.Minute]
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!