DiamondMatrix¶
Creates a diamond-shaped matrix of ones.
$ wo 'DiamondMatrix[2]'
{{0, 0, 1, 0, 0}, {0, 1, 1, 1, 0}, {1, 1, 1, 1, 1}, {0, 1, 1, 1, 0}, {0, 0, 1, 0, 0}}
A second argument centres the diamond in a grid of zeros that wide: