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

 採用された回答

Image Analyst
Image Analyst 2012 年 7 月 20 日

0 投票

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 ExchangeDownloads についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by