Skip to main content

Diagonal matrix

Constructs a diagonal matrix.

Syntax

diagonal_matrix(List | Range | Vector)
diagonal_matrix(Integer, Expression)

Description

Given a list, range or vector L, constructs a diagonal matrix with the elements of LL 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 ee.

linear_algebra.diagonal_matrix2.calc.png