IsScalar
Tests if a matrix is a scalar multiple of the identity matrix.
Syntax

IsScalar(A[, ε])

A
is a matrix 
ε
is a positive number

Description
If A
is a matrix then IsScalar(A, ε)
is true
iff A
is square and there is a number z
such that A[i, j]
is equal to z
if i = j
and equal to 0
otherwise (all comparisons made with epsilon ε
).
Examples
IsScalar(❨❨5, 0, 0❩, ❨0, 5, 0❩, ❨0, 0, 5❩❩)
true