Average every n*n elements in a two dimensional matrix
古いコメントを表示
I have a two dimensional matrix, and create a second matrix with the averages of every n*n elements. So, say I have a 100*100 matrix; I would want a 10*10 matrix where each single element is the average of the 10*10 elements in the original matrix at that location.
So far I have tried splitting the matrix into n separate row vectors, averaging each of those every n elements, concatenating and re averaging ever n of the averaged vectors. Then I concatenate each of those vectors. Is there a more efficient way to do this this, without using so many loops? It is very inefficient and inelegant for such a large matrix.
Thanks
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Neighborhood and Block Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!