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
<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>.
There are also some inexact matches for
?? diagmatrix to see them.
(%o1) true (%i2)