linalg(deprecated)
diag
create a block diagonal matrix
BlockDiagonal
a synonym for diag
Calling Sequence
Parameters
Description
Examples
diag(B1, B2, .., Bn)
BlockDiagonal(B1, B2, ..., Bn)
B[1], B[2], ..., B[n]
-
square matrices or scalar matrix entries
Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[DiagonalMatrix], instead.
- For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
The call diag(B1, B2, .., Bn) returns a matrix on whose diagonal are the matrix blocks B1, B2, .., Bn.
If used in conjunction with JordanBlock, diag can be used to easily create a Jordan form matrix.
The command with(linalg,diag) allows the use of the abbreviated form of this command.
with⁡linalg:
B1≔array⁡1,3,5,9,a,z,x2,sin⁡q,10
B1≔1359azx2sin⁡q10
B2≔matrix⁡2,2,1,3,2,4
B2≔1324
diag⁡B1,B2
135009az00x2sin⁡q10000001300024
diag⁡λ1,λ2
λ100λ2
See Also
linalg(deprecated)[companion]
linalg(deprecated)[JordanBlock]
LinearAlgebra
Download Help Document