Find duplicate of first xx entries and average associated values
3 次查看(过去 30 天)
显示 更早的评论
Hi all,
I have 140000x3 array data (time, lat, lon). The time column looks like [2019/12/18 上午 07:53:00]. I would like to get the mean lon and lat of several points in the same minute, like [2019/12/18 上午 07:53].
Thanks
5 个评论
Chris Burschyk
2022-7-7
You could load the data into a timetable and then use something like
T = readtimetable("YourFile.csv");
YourYear = 2019;
YourMonth = 1;
YourDay = 8;
YourHour = 8;
YourMin = 41:
mean(T{T.SYSTEMTIME.Year == YourYear & T.SYSTEMTIME.Month == YourMonth & T.SYSTEMTIME.Day == YourDay & T.SYSTEMTIME.Hour == YourHour & T.SYSTEMTIME.Minute == YourMinute, "LONGITUDE" })
Maybe not the prettiest way to do, but you could use it with a loop as well.
另请参阅
类别
在 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!