Learn R Programming

hisemi (version 1.1-0)

directSum: Direct sum of matrices

Description

Direct sum of matrices, i.e., put matrices along the diagonal

Usage

directSum(...)

Arguments

matrices to be directSumed.

Value

A matrix, which is the direct sum of ….

Details

The function treats each matrix as an element and put the element along the diagonal line.

Examples

Run this code
# NOT RUN {
A=matrix(1:9,3,3)
all.equal(directSum(A), A) #TRUE
(B=directSum(-1,A))
directSum(A,B)
# }

Run the code above in your browser using DataLab