Clear Filters
Clear Filters

Average Values in a matrix

2 views (last 30 days)
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.

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 29 Apr 2016
a=rand(100,225)
out=blockproc(a,[4 4],@(x) mean(mean(x.data)))

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!