Function: flatten - entries of a structure involving lists, sets, or arrays
Calling sequence:
flatten(expr);
Parameters:
expr - the expression
Description:
Examples:
> flatten([{{a,b},{c,d}}]);
> M:= matrix([[1,2],[3,2]]);
> flatten(M);
> Q:= array(1..2,1..2,1..2,[[[1,2],[3,4]],[[5,6],[7,8]]]):
> flatten(Q);
> flatten(Matrix(M));
> flatten(Array(Q));
In the following example, T is implicitly constructed as a table by assigning values to its elements. Note that convert(T, list) might not return the entries in the order of the indices, but flatten(T) does.
> T[1]:= first: T[3]:= third: T[2]:= second:
> convert(T,list);
> flatten(T);
See also:
array , convert(list) , list , rtable , set , table
Maple Advisor Database R. Israel 1998