I would like to transfer the matrix above into a 4 by 4 matrix with the same order as ATTACHMENT blow. Please do not hard code it. I would like to see some functions to help me to overcome this problem thank you
ArrayFlatten[a]
or
Flatten[a, {{1, 3}, {2, 4}}] (* list of list of dimensions to merge *)
ArrayFlatten is nice. I under-use that function...
Thanks
Marco
I rarely use it actually, I go with Flatten generally. I think Flatten has all the functionality of ArrayFlatten 'inside it'
Hi Sheng Dai,
is this what you are looking for?
a = {{{{"a", "b"}, {"c", "d"}}, {{"e", "f"}, {"g", "h"}}}, {{{"i", "j"}, {"k", "l"}}, {{"m", "n"}, {"o", "p"}}}}; Partition[Flatten[Transpose /@ a], 4] // MatrixForm
Cheers,
Thank you Marco, that is a great help. And thank you everyone.