Kronecker tensor product of two matrices.

kron(a, b)

Arguments

a

real or complex matrix

b

real or complex matrix

Details

The Kronecker product is a large matrix formed by all products between the elements of a and those of b. The first left block is a11*b, etc.

Value

an (n*p x m*q-matrix, if a is (n x m and b is (p x q).

Note

kron() is an alias for the R function kronecker(), which can also be executed with the binary operator `%x%'.

Examples

a <- diag(1, 2, 2)
b <- matrix(1:4, 2, 2)
kron(a, b)
#>      [,1] [,2] [,3] [,4]
#> [1,]    1    3    0    0
#> [2,]    2    4    0    0
#> [3,]    0    0    1    3
#> [4,]    0    0    2    4
kron(b, a)
#>      [,1] [,2] [,3] [,4]
#> [1,]    1    0    3    0
#> [2,]    0    1    0    3
#> [3,]    2    0    4    0
#> [4,]    0    2    0    4