|
SOLUTIONS
|
BUILT-IN MATHEMATICA SYMBOL
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].
- All the forms of padding accepted by ArrayPad can be specified. The default padding value is
. - ArrayReshape works with SparseArray objects.
ExamplesExamplesopen allclose all
Basic Examples (4)Basic Examples (4)
| In[1]:= |
| Out[1]= |
Use ArrayReshape to make a vector into a rank-3 array:
| In[1]:= |
| Out[1]= |
| In[1]:= |
| Out[1]= |
Use rule-based padding values:
| In[1]:= |
| Out[1]= |
New in 9
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
