diag_matrix SciMax Toolbox diagmatrixp

SciMax Toolbox >> diagmatrix

diagmatrix

Maxima Function

Calling Sequence

diagmatrix (n, x)

Description

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.

diag_matrix SciMax Toolbox diagmatrixp