How to average array into bins (bin-averaging)

I have two arrays which I need to be the same size for further analysis. One is sediment concentration with depth, where "conc" is 253x2006 (253 depths and 2006 time points). The other is water velocity with depth, where "vel" is 6x2006 (6 depths and same 2006 time points). The depths for "vel" have a coarser resolution but they all fall within the range of the 253 finer-res depths for "conc". My problem has been trying to bin-average the concentration data to the bins of the velocity data. In other words I want to average "conc" to the same 6 bin values as "vel", with each bin centered on the original 6 depth values of "vel".
Any thoughts on how to approach this would be much appreciated! Let me know if further information is needed.

댓글 수: 2

Matt J
Matt J 2017년 7월 29일
But 6 does not divide evenly into 253. Is that the problem?
That was definitely part of it. A simple oversight on my part. Thanks!

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt J
Matt J 2017년 7월 29일
편집: Matt J 2017년 7월 29일

0 개 추천

Assuming it's a typo that conc doesn't divide evenly into 6 bins, then you could use SEPBLOCKFUN ( Download), e.g.
>> A=sepblockfun( rand(300,2006) , [50,1], @mean); Whos A
Name Size Kilobytes Class Attributes
A 6x2006 95 double

카테고리

도움말 센터File Exchange에서 Waves에 대해 자세히 알아보기

질문:

2017년 7월 28일

댓글:

2017년 8월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by