Problem 60753. 2x2 binning of a large sparse matrix
Consider the 20000 x 20000 sparse matrix,
A=round(sprand(2e4,2e4,1/1e4*100)*1000);
The task is to divide this matrix into 2x2 tiles and to form the reduced 10000 x 10000 matrix B such that B(i,j) is the sum over the elements of (i,j)-th tile of A. For example,
B(1,1) = A(1,1)+A(2,1)+A(1,2)+A(2,2)
B(2,1) = A(3,1)+A(4,1)+A(3,2)+A(4,2)
etc...
Your solution must execute in less than 0.3 sec.
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers4
Suggested Problems
-
2x2 binning of a large sparse matrix
4 Solvers
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!