Inspired from Problem 1078. Make a diamond

In this problem the output will be a logical matrix The input n is still odd. For example if n = 5 you will get the logical matrix :

m =
       0     0     1     0     0
       0     1     0     1     0
       1     0     0     0     1
       0     1     0     1     0
       0     0     1     0     0

Second thing, you must use the GALLERY function :-)

Documentation R2012b to use gallery

Solution Stats

350 Solutions

106 Solvers

Last Solution submitted on Dec 16, 2025

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers106

Suggested Problems

More from this Author30

Problem Tags

Community Treasure Hunt

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

Start Hunting!