How to group a collection of values in a vector?
4 ビュー (過去 30 日間)
古いコメントを表示
I have a data set that is made up of measurements done every 6 hours over the course of a year. So that is 1460 for an ordinary year and 1464 for a leap year. I am having trouble grouping them so that the values of each 4x6 hour group is averaged into a day.
Each year is a vector.
0 件のコメント
採用された回答
Rik
2018 年 7 月 11 日
There are a myriad of way to do this, one of them should be the code below.
data=1:12;%example data
data=reshape(data,4,[]);%reshape so each day is a column (hence 4 rows)
dayly_mean=mean(data,1);
2 件のコメント
Rik
2018 年 7 月 14 日
Did this suggestion solve your problem? If so, please consider marking it as accepted answer. It will make it easier for other people with the same question to find an answer. If this didn't solve your question, please comment with what problems you are still having.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!