Mathematica 9 is now available

Flatten

Usage

Flatten[list] flattens out nested lists.
Flatten[list, n] flattens to level n.
Flatten[list, n, h] flattens subexpressions with head h.


Notes

• Example: Flatten[ a, b,c , d  ]LongRightArrow .
Flatten "unravels" lists, effectively just deleting inner braces.
Flatten[list, n] effectively flattens the top level in list n times.
Flatten[f[e, ... ]] flattens out subexpressions with head f.
Flatten flattens out levels in SparseArray objects just as in the corresponding ordinary arrays.
• See also: Partition, FlattenAt.
• New in Version 1.


Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.