Maxima Function
diagmatrix (n, x)
Returns a diagonal matrix of size n by n with the
diagonal elements all equal to x.
diagmatrix (n, 1)
returns an identity matrix (same as ident (n)
).
n must evaluate to an integer, otherwise diagmatrix
complains with an error message.
x can be any kind of expression, including another matrix. If x is a matrix, it is not copied; all diagonal elements refer to the same instance, x.