Data Processing: Average value of every ten values.

Hi,
Currently I am analyzing data sets of unknown length and I need to take an average of every ten values. However, I do not wish to discard the remainder.
For example, my last data set has 84 values. How can I take the average of every ten values through 80 and then average the last 4 values with 6 from the previous set?
This may be a strange request, but any ideas would be greatly appreciated!!
Best Regards,
Stephen

 采纳的回答

Actually it's a very, very common request (except for the tacking on 6 additional elements part). First you need to tack on those 6 (easy enough - I figure you can do that much), then something like
array2D = reshape(your1Darray, [10, 9]);
means = mean(array2D, 1);

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Downloads 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by