arranges the elements of list into a rectangular array with dimensions dims.

uses the specified padding if list does not contain enough elements.


  • 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,dims]] 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
Translate this page: