Try this, if you have the Image Processing Toolbox.
data = randi(9, 8772, 5);
newData = circshift(data, -6, 1);
meanFilterFunction = @(theBlockStructure) mean(theBlockStructure.data(:));
blockSize = [12, 1];
blockMeans = blockproc(newData, blockSize, meanFilterFunction)
[rows, columns] = size(blockMeans)
Best Answer