I have a 100X225 matrix- I want to average [4,4] (or other) chunks of the matrix, and place that value in a new matrix: of a smaller dimension -> 100/4,225/4 etc
I can't seem to get the looping right.

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 29일

0 개 추천

a=rand(100,225)
out=blockproc(a,[4 4],@(x) mean(mean(x.data)))

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by