#17: Square and Diagonal Matrices

Tagged as challenge

Written on 2018-01-30

Write functions square-matrix? and diagonal-matrix? to determine if a matrix is square (same number of rows and columns), or if a matrix is diagonal (the only non-zero entries are those on the diagonal).


Unless otherwise credited all material copyright © 2010–2018 by Robert Smith