Flatten - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


ListTools

  

Flatten

  

flatten a list containing lists of elements

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Flatten(L, N)

Parameters

L

-

list

N

-

non-negative integer

Description

• 

The Flatten(L) function recursively converts any elements in a list which are of type list to expression sequences.

• 

The Flatten(L, N) function flattens a nested list of lists N times.

  

Note: The inlined procedure FlattenOnceL is more efficient than a call to Flatten(L, 1).

Examples

withListTools:

L1,2,3,4,5,6

L1,2,3,4,5,6

(1)

FlattenL

1,2,3,4,5,6

(2)

L1,2,3,4,5,6

L1,2,3,4,5,6

(3)

FlattenL

1,2,3,4,5,6

(4)

FlattenL,1

1,2,3,4,5,6

(5)

See Also

list

ListTools

ListTools[FlattenOnce]

seq

type/list