How to check if my time series has a repeated hour in a matrix of 10200 rows?
3 次查看(过去 30 天)
显示 更早的评论
Hello, I have this time series matrix from 01/01/2019 to 29/02/2020, hourly. I would like to know if in some part of the matrix the hour or the day, is repeated with respect to the previous row? I appreciate if anyone knows how I can find that, Thank you.
Var 1 yy mm dd hh min
737426 2019 1 1 0 0
737426.041666667 2019 1 1 1 0
737426.083333333 2019 1 1 2 0
737426.125000000 2019 1 1 3 0
737426.166666667 2019 1 1 4 0
737426.208333333 2019 1 1 5 0
737426.250000000 2019 1 1 6 0
737426.291666667 2019 1 1 7 0
737426.333333333 2019 1 1 8 0
737426.375000000 2019 1 1 9 0
737426.416666667 2019 1 1 10 0
737426.458333333 2019 1 1 11 0
737426.500000000 2019 1 1 12 0
737426.541666667 2019 1 1 13 0
737426.583333333 2019 1 1 14 0
737426.625000000 2019 1 1 15 0
737426.666666667 2019 1 1 16 0
737426.708333333 2019 1 1 17 0
737426.750000000 2019 1 1 18 0
737426.791666667 2019 1 1 19 0
737426.833333333 2019 1 1 20 0
737426.875000000 2019 1 1 21 0
737426.916666667 2019 1 1 22 0
737426.958333333 2019 1 1 23 0
737427 2019 1 2 0 0
737427.041666667 2019 1 2 1 0
737427.083333333 2019 1 2 2 0
... Until February 2020
0 个评论
采纳的回答
jonas
2020-7-28
Convert everything to datetime and then check the difference
%some data, note that 2000-1-1 10:00:00 is repeated
t = datetime(2000,1,1,[0:10,10:100],0,0);
%find instances where the difference is smaller than 1h
id = find(diff(t) < hours(1))
id =
11
更多回答(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!