https://www.mathworks.com/matlabcentral/answers/406864-how-do-i-sum-over-one-dimension-of-a-multidimensional-array
How to sum up over dates?
11 次查看(过去 30 天)
显示 更早的评论
I have table with T
date location sales
--------------------
1/1 NY 100
1/2 NY 105
1/1 LA 70
1/2 LA 90
I want to sum up over dates to create T1 with
1/1 170
1/2 195
What is the next step?
采纳的回答
Cris LaPierre
2021-7-29
编辑:Cris LaPierre
2021-7-29
Convert your dates to datetimes and use groupsummary with the groupbins input set to 'day' and your method set to 'sum', and datavars specified as your sales variable. Use the following syntax.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!