dae (version 3.2.25)

mat.dirsum: Forms the direct sum of a list of matrices

Description

The direct sum is the partitioned matrices whose diagonal submatrices are the matrices from which the direct sum is to be formed and whose off-diagonal submatrices are conformable matrices of zeroes. The resulting matrix is \(m \times n\), where \(m\) is the sum of the numbers of rows of the contributing matrices and \(n\) is the sum of their numbers of columns.

Usage

mat.dirsum(matrices)

Value

An \(m \times n\)

matrix.

Arguments

matrices

A list, each of whose component is a matrix.

Author

Chris Brien

See Also

mat.dirprod, matmult

Examples

Run this code
       m1 <- matrix(1:4, nrow=2)
       m2 <- matrix(11:16, nrow=3)
       m3 <- diag(1, nrow=2, ncol=2)
       dsum <- mat.dirsum(list(m1, m2, m3))

Run the code above in your browser using DataLab