MATLAB: Average every n elements in matrix

averageImage Processing Toolboxvideo processing

I have a 67560×75 matrix that consists of 40×75 matrices tiled on top of each other for 1689 frames of video.
I want to get a 40×75 matrix where each element is the average of the corresponding (i,j) position over all 1689 frames. Thanks

Best Answer

squeeze( mean(reshape(M, 40, [], 75),2) )
Related Question