How to average array into bins (bin-averaging)
Mostrar comentarios más antiguos
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 comentarios
Matt J
el 29 de Jul. de 2017
But 6 does not divide evenly into 253. Is that the problem?
Kevin Simans
el 3 de Ag. de 2017
Respuestas (1)
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
Categorías
Más información sobre Waves en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!