>>588845/48
ans =
12267.604
The number of rows is not divisible by 48. What are you planning to do with the last few rows?
Assuming you have a number of rows divisible by 48, the easiest is to reshape the matrix into 48 rows, and take the mean along the rows.
m = reshape(1:5888450, 588845, 10);
croppedm = m(1 : size(m,1)-mod(size(m, 1), 48), :);
meancroppedm = squeeze(mean(reshape(croppedm, 48, [], size(m, 2)), 1))
The mean of the last portion:
meancutm = mean(m(size(m, 1)-mod(size(m, 1),48) : end, :), 1)
The two combined
mean48 = [meancroppedm; meancutm]
Best Answer