Grouping vector data based on different intervals

6 ビュー (過去 30 日間)
IMMOBLADE
IMMOBLADE 2021 年 8 月 12 日
編集済み: Matt J 2021 年 8 月 12 日
Hi community,
I have vector data with values for each hour in a year (i.e 24*365 = 8760 vector length).
I'm just looking for simple tips to group data based on intervals, like :
1) Sum of values per day (interval 24) in a vector with length 365...
2) Sum of values per hour for each day in a vector with length 24...
Thanks to all !

採用された回答

Matt J
Matt J 2021 年 8 月 12 日
編集済み: Matt J 2021 年 8 月 12 日
Sounds like it would be better to have your data organized as a 24x365 matrix instead of as a vector.
A=reshape(data,24,365);
sum(A,1)
sum(A,2)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by