powered by
Direct sum of matrices, i.e., put matrices along the diagonal
directSum(...)
matrices to be directSumed.
directSum
A matrix, which is the direct sum of ….
The function treats each matrix as an element and put the element along the diagonal line.
# 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