Diagonal matrix

Constructs a diagonal matrix.

Syntax

 Vector)
diagonal_matrix(Integer, Expression)

Description

Given a list, range or vector L, constructs a diagonal matrix with the elements of LLaTeXL in the diagonal.

linear_algebra.diagonal_matrix1.calc.png

Given an integer n and an expression e, constructs a diagonal matrix of dimension n×n with coefficients equal to eLaTeXe.

linear_algebra.diagonal_matrix2.calc.png