ArrayReshape

ArrayReshape[list,dims]
arranges the elements of list into a rectangular array with dimensions dims.

ArrayReshape[list,dims,padding]
uses the specified padding if list does not contain enough elements.

DetailsDetails

  • ArrayReshape always gives a rectangular array of the specified dimensions, ignoring the last elements or adding new elements as necessary.
  • Elements are arranged in the resulting array so that up to length, Flatten[ArrayReshape[list]] is the same as Flatten[list].
  • In ArrayReshape[list,dims,padding], any padding scheme supported by ArrayPad can be specified. The default padding value is .
  • ArrayReshape works with SparseArray objects.
Introduced in 2012
(9.0)