Learn R Programming

pracma (version 1.7.0)

blkdiag: Block Diagonal Matrix

Description

Build a block diagonal matrix.

Usage

blkdiag(...)

Arguments

...
sequence of non-empty, numeric matrices

Value

  • a numeric matrix

Details

Generate a block diagonal matrix from A, B, C, .... All the arguments must be numeric and non-empty matrices.

See Also

Diag

Examples

Run this code
a1 <- matrix(c(1,2), 1)
a2 <- as.matrix(c(1,2))
blkdiag(a1, diag(1, 2, 2), a2)

Run the code above in your browser using DataLab