kron
Kronecker tensor product of two matrices.
Category: Mathematics > Linear Algebra
Syntax
K = kron(A, B)
Replaces each entry A(i,j) by the block A(i,j)*B.
Description
The Kronecker product arranges all the products of one entry of A with one entry of B into a large block matrix. It is not commutative. It is used to build operators on tensor-product spaces, for example the 2-D Laplacian from 1-D ones, and satisfies (A kron B)(C kron D) = (A*C) kron (B*D).
Input arguments
A, B- Numeric arrays of any size.
Output arguments
K- Matrix of size
[size(A,1)*size(B,1), size(A,2)*size(B,2)].
Example
Block structure
kron([1 2], [1; 1])
kron(eye(2), [1 2; 3 4])
Output
ans = 2×2
1 2
1 2
ans = 4×4
1 2 0 0
3 4 0 0
0 0 1 2
0 0 3 4