Previous Up Next

6.40.14  Flattening a list: flatten

The flatten command replaces any sublists of a list by their elements.


Example.
Input:

flatten([[1,[2,3],4],[5,6]])

Output:


1,2,3,4,5,6


If the original list is a matrix, you can also use the mat2list command for this (see Section 6.40.33).


Previous Up Next