flatten a list containing lists of elements - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Data Types : Tables, lists, and sets : ListTools Package : ListTools/Flatten

ListTools[Flatten] - flatten a list containing lists of elements

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:

L:=1,2,3,4,5,6

L:=1,2,3,4,5,6

(1)

FlattenL

1,2,3,4,5,6

(2)

L:=1,2,3,4,5,6

L:=1,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


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam