Constructs a block diagonal matrix
The function takes a list
and constructs a block diagonal matrix with
the elements of the list on the diagonal. If d
is not a list then
d
will be repeated n
times and written on the diagonal (a wrapper for kronecker()
)
diag.block(d, n)
d |
a |
n |
number of repetitions |
returns a matrix with the elements of the list or the repetitions of the supplied matrix or vector on the diagonal.
Wolfgang Lederer, wolfgang.lederer@gmail.com
a <- matrix(rep(1, 4), nrow = 2) b <- matrix(rep(2, 6), nrow = 2) e <- c(3, 3, 3, 3) f <- t(e) d <- list(a, b, e, f) diag.block(d) diag.block(a, 3)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.