Problem 42856. Block average
Given a matrix, calculate the block average of each disjoint sub-matrix of the same size. Assume that the size of the matrix along each dimension is an integer multiple of the size of the sub-matrix along the same dimension.
- Input: matrix A and the size of each sub-matrix subsz
- Output: B = blkavg(A,subsz)
Example:
A = [2 0 1 3 5 7]; subsz = [1 2]; B = [1 2 6];
Hint: this is related to Problem 42854. Crunch that matrix!.
Next problem: Problem 42858. Block average ignoring NaN values
Solution Stats
Problem Comments
-
1 Comment
It's related to that problem in another way. I'm getting a similar error to Zikobrelli did: "Error using VisibleTest1 (line 4)"
Solution Comments
Show commentsProblem Recent Solvers41
Suggested Problems
-
271 Solvers
-
Get the elements of diagonal and antidiagonal for any m-by-n matrix
462 Solvers
-
Create Volcano (or Atoll) martix. It is an extension of Bullseye matrix problem.
129 Solvers
-
94 Solvers
-
Write a function man that takes a row vector v and returns a matrix H as follows..
593 Solvers
More from this Author29
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!