How to find the mean of categorical data
6 次查看(过去 30 天)
显示 更早的评论
How can I find the mean distance travelled on each day of the week over a certain period of time. I have the distance travelled for each day but need to find the mean for each week day.
回答(1 个)
Sindar
2020-2-12
check out splitapply. You may need to change the format of your data, but it does exactly what you want:
G = findgroups(Day);
mean_dist = splitapply(@mean,distance,G);
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!