linalg(deprecated)/diag - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : linalg(deprecated)/diag

linalg(deprecated)

  

diag

  

create a block diagonal matrix

  

BlockDiagonal

  

a synonym for diag

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

diag(B1, B2, .., Bn)

BlockDiagonal(B1, B2, ..., Bn)

Parameters

B[1], B[2], ..., B[n]

-

square matrices or scalar matrix entries

Description

• 

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.

Examples

Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[DiagonalMatrix], instead.

> 

with⁡linalg:

> 

B1≔array⁡1,3,5,9,a,z,x2,sin⁡q,10

B1≔1359azx2sin⁡q10

(1)
> 

B2≔matrix⁡2,2,1,3,2,4

B2≔1324

(2)
> 

diag⁡B1,B2

135009az00x2sin⁡q10000001300024

(3)
> 

diag⁡λ1,λ2

λ100λ2

(4)

See Also

linalg(deprecated)[companion]

linalg(deprecated)[JordanBlock]

LinearAlgebra