Averaging data every N rows
이전 댓글 표시
hi all, I have a matrix in dim of 8761*5 I want to average the data every 12 rows, starting from the 7th row to 19th and so on. the last 6 rows should be with the first 6 rows. the final dim should be 731*5
thanks for help.
댓글 수: 2
Image Analyst
2016년 1월 3일
If you ignore the first 6 rows, then you have 8755 left. Taking groups of 12, you'd have 729.583333333333 sets of 12 because it's not a multiple of 12. So how do you get 731?
And we have no idea what "the last 6 rows should be with the first 6 rows." means. Does it mean group rows 1-6 (first 6) together with rows 8756-8761 (the last 6) when taking the mean?
Lilya
2016년 1월 3일
채택된 답변
추가 답변 (1개)
Image Analyst
2016년 1월 3일
Try
data = [data(6:end-6);data(1:6,:)];
or use circshift().
카테고리
도움말 센터 및 File Exchange에서 Get Started with Computer Vision Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!