IsDiag(M) = Returns 1 if M is a diagonal matrix, else 0:
If M is a square matrix with all off diagonal elements equal to zero, the result is 1, else 0. If M is a scalar, 0 is returned.
Return to Matrix and Polynomial Computations
Return to Harry's Home Page