how to take average of every 10 rows in one column?

9 views (last 30 days)
i have data which contains number of rows = 30750, number of column = 1. how to get new column such that it should contain average value of every 10 rows?

Answers (1)

Dyuman Joshi
Dyuman Joshi on 18 Aug 2022
Moved: Jan on 18 Aug 2022
Assuming you mean average of rows in pairs (1-10, 11-20, 21-30)
%random data
y=rand(30750,1); %30750x1 data
z=reshape(y,10,[]);
mu=mean(z)';
size(mu)
ans = 1×2
3075 1

Categories

Find more on Random Number Generation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!