Create an N×N matrix that forms a hollow diamond shape using 1s, leaving the interior empty. This challenge emphasizes boundary detection and symmetry handling.
e.g. N=5
1 1 0 1 1;
1 0 1 0 1;
0 1 1 1 0;
1 0 1 0 1;
1 1 0 1 1

Solution Stats

31 Solutions

15 Solvers

Last Solution submitted on May 24, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers15

Suggested Problems

More from this Author39

Problem Tags

Community Treasure Hunt

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

Start Hunting!