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

13 Solutions

8 Solvers

Last Solution submitted on Sep 17, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers8

Suggested Problems

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!