Dimensions

Dimensions[expr]

gives a list of the dimensions of expr.

Dimensions[expr,n]

gives a list of the dimensions of expr down to level n.

Details and Options

  • expr must be a full array, with all the pieces of expr at a particular level having the same length. (The elements of expr can then be thought of as filling up a hyperrectangular region.)
  • Each successive level in expr sampled by Dimensions must have the same head.
  • For SparseArray and StructuredArray objects, Dimensions yields the dimensions of the corresponding ordinary lists.

Examples

open allclose all

Basic Examples  (1)

Dimensions of a matrix:

In[1]:=
Click for copyable input
Out[1]=

Scope  (2)

Generalizations & Extensions  (4)

Applications  (1)

Properties & Relations  (1)

See Also

ArrayDepth  Length  VectorQ  MatrixQ

Tutorials

Introduced in 1988
(1.0)
| Updated in 2012
(9.0)