powered by
Split a vector x into a block diagonal matrix.
blodiag(x, blo)
A vector of length n.
n
A vector of positive integers such that sum(blo) == n.
sum(blo) == n
A block-diagonal matrix with as many row as elements of blo and n columns. The vector x is split into length(blo) sub-vectors and these are the blocks of the resulting matrix.
blo
x
length(blo)
blkdiag, diag
blkdiag
diag
# NOT RUN { blodiag(1:10, blo = c(2, 3, 5)) blodiag(1:10, blo = c(3,4,0,1)) # }
Run the code above in your browser using DataLab