finding the average of specific rows in each column
Show older comments
Hi,
I have a matrix variable called "out" and it consists of 24 columns and 200000 rows. I want the average of the consecutive 24 rows of every column. The example below illustrates what I want.
average of rows 1-24 from every column (24 columns in total) average of rows 25-49 from every column (24 columns in total) everage of rows 50-74 from every column (24 columns in total) and so on
I really appreciate your help.
Accepted Answer
More Answers (1)
[m,n]=size(out);
m=floor(m/24)*24;
out=out(1:m,:); %throw away extra rows
out=mean(reshape(out,24,[]));
out=reshape(out,[m/24,n])
Categories
Find more on Image Arithmetic 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!