MATLAB: Find mean for each 4 row in 124×7 matrix

mean through rows

Hi all ,,,
I have matrix U=124 x 7
I want to find the mean through all 4 rows of each column
the result be 31 x7

Best Answer

b=mat2cell(U,repmat(4,1,size(U,1)/4)); % where U is 124 X 7 matrix
R=cellfun(@(x) mean(x),b,'un',0);
Result=vertcat(R{:})
Related Question