https://www.mathworks.com/matlabcentral/answers/406864-how-do-i-sum-over-one-dimension-of-a-multidimensional-array
How to sum up over dates?
7 ビュー (過去 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.
13 件のコメント
Cris LaPierre
2021 年 7 月 29 日
See my previous reply. All methods are applied to all datavars.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で MATLAB Compiler についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!