# List Manipulation : {{{a,b},{c,d}},{{e,f},{g,h}}} into {{a,b},{c,d},{e,f},{g,h}}

Hi I'd like to transform the matrix :

{{{184.586, 1.02758*10^8}, {139.94, 4.07249*10^7}, {117.72,
2.26123*10^7}, {109.528, 1.51412*10^7}, {95.7636,
8.68593*10^6}, {78.125, 5.16118*10^6}, {66.6777,
3.1014*10^6}}, {{183.505, 1.01147*10^8}, {138.25,
4.02021*10^7}, {115.814, 2.24641*10^7}, {108.22,
1.50985*10^7}, {91.3082, 9.28241*10^6}, {78.1087,
6.03119*10^6}, {65.9855, 3.56718*10^6}}}


with the same transformation as

{{{a,b},{c,d}},{{e,f},{g,h}}}


into

{{a,b},{c,d},{e,f},{g,h}}


How can I do plz ?

• At least closely related: mathematica.stackexchange.com/q/5233/5478
– Kuba
Jun 27, 2019 at 8:31
• I guess gh is a typo and should be g, h. Anyway, it's a bit uncertain what you actually are trying to do. One way to achieve the structural change seen here is Join @@ {{{a,b},{c,d}},{{e,f},{g,h}}}... (This can be also defined as a function Apply[Join]. Another, probably more understandable way is Flatten[{{{a,b},{c,d}},{{e,f},{g,h}}}, 1]. Jun 27, 2019 at 8:38

Flatten might be something you need:

listNested = {{{a, b}, {c, d}}, {{e, f}, {g, h}}};
Flatten[listNested, {1, 2}]



output:

{{a, b}, {c, d}, {e, f}, {g, h}}

Catenate@list


where

list = {{{a,b},{c,d}},{{e,f},{g,h}}}


{{a, b}, {c, d}, {e, f}, {g, h}}

You can also use Join:

Apply[Join] @ {{{a, b}, {c, d}}, {{e, f}, {g, h}}}


{{a, b}, {c, d}, {e, f}, {g, h}}

Alternative/equivalent form: Join @@ {{{a, b}, {c, d}}, {{e, f}, {g, h}}}