This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# ArrayFlatten

 ArrayFlattencreates a single flattened matrix from a matrix of matrices . ArrayFlattenflattens out r pairs of levels in the array a.
• ArrayFlatten requires that the blocks it flattens have dimensions that fit together.
• ArrayFlatten can be used to form block matrices from arrays of blocks.
• For a matrix of matrices, ArrayFlatten[a] yields a matrix whose elements are in the same order as in MatrixForm[a].
• For a tensor with rank 2r, ArrayFlatten gives a tensor with rank r.
• In ArrayFlatten all the matrices in the same row must have the same first dimension, and matrices in the same column must have the same second dimension.
• In general, in ArrayFlatten, all the k dimensions of must be equal for each possible value of .
• Elements at level r whose array depth is less than r are treated as scalars, and are replicated to fill out a rank r array of the appropriate dimensions.
Create a block matrix by flattening out a matrix of matrices:
Use 0s to represent zero matrices:
Create a block matrix by flattening out a matrix of matrices:
 Out[2]=

Use 0s to represent zero matrices:
 Out[2]=
 Scope   (4)
Flatten a rank 4 array to rank 2:
Flatten only the first four levels of a rank 6 array:
Flatten a rank 6 array to rank 3:
ArrayFlatten works with SparseArray objects:
Make a sparse matrix from a block matrix of SparseArray objects:
 Applications   (4)
Put together many copies of a "tile":
Iterate a 2D substitution system:
Iterate a 3D substitution system:
Form a block matrix semidiscretization of the wave equation with n spatial points:
Differentiation matrix for second-order approximation of with periodic boundary conditions:
Identity matrix of size n:
Form block matrix a for system where :
Set up an initial condition vector for :
Approximate the solution at using the backward Euler method with time step k:
Show and at :
MatrixForm displays matrices of matrices in the same order as ArrayFlatten:
ArrayFlatten is a special case of Flatten:
KroneckerProduct is defined as ArrayFlatten of an Outer product:
New in 6