prints with the elements of list arranged in a regular array.

Details and Options

  • In StandardForm the array is shown enclosed in parentheses.
  • MatrixForm prints a singlelevel list in a column. It prints a twolevel list in standard matrix form. More deeply nested lists are by default printed with successive dimensions alternating between rows and columns.
  • Elements in each column are by default centered.
  • MatrixForm prints SparseArray objects like the corresponding ordinary lists. »
  • MatrixForm takes the same set of options as TableForm.
  • MatrixForm acts as a "wrapper", which affects printing, but not evaluation.


open allclose all

Basic Examples  (3)

Show the matrix form of a matrix:

Show the matrix form of a SparseArray:

Show vector, matrix, and general arrays in matrix form:

Scope  (3)

Matrices of numbers and formulas:

A matrix of lists:

Use options to control the layout directions:

Generalizations & Extensions  (2)

Format a SparseArray object in matrix form:

Format a SymmetrizedArray object in matrix form:

Options  (6)

TableAlignments  (2)

Specify the alignment of columns:

Set alignments for successive dimensions:

TableDepth  (1)

By default, all dimensions are formatted:

Only use matrix formatting for the outermost dimension:

TableDirections  (1)

By default, the outermost dimension is a column:

Format the first dimension as a row instead:

TableHeadings  (1)

Specify headings for rows:

Specify headings for columns:

Specify headings for rows and columns:

TableSpacing  (1)

The default automatic spacing:

Explicitly specify the spacing between rows and between columns:

Applications  (4)

Display special matrices with matrix formatting:

Matrices from a matrix decomposition:

Formula for a matrix multiplication:

Display a block matrix as a matrix of matrices:

The array flattened to a matrix:

Properties & Relations  (5)

MatrixForm formats arrays using standard matrix formatting:

TableForm formats arrays in a tabular form:

Grid formats two-dimensional arrays as a grid:

Use MatrixPlot to visualize the structure of large matrices:

Use ArrayPlot to visualize the structure of large discrete matrices:

Use Style to affect the display of MatrixForm:

Use any number form such as ScientificForm or BaseForm to affect the display of numbers:

Introduced in 1988
Updated in 1996