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 Sander,
I guess you are right. I notice that I often use "more common", but perhaps more flexible commands to achieve inbuilt functionality. It's a little bit like with any other Language: The more proficient you are the more precise words you can actively use. That makes it more elegant.
So, I have got to go back to learning more Wolfram Language Vocabulary. The Wolfram Language is now at what - 6000+ "words"?In spoken languages one is proficient with a vocabulary of about 5000 words or so, albeit this being more complicated than that. You are expected to know about 500 words for a C2 level for "Cambridge Proficiency in English". I admit that the functions in Mathematica are somewhat different from words in a language, but there is often a fair amount of maths background required to fully appreciate them.
At school, we did "word-tournaments" where pupils would do a one-to-one fight, being asked words in a foreign language. The first not to know a given word would lose the battle. It might be interesting to write a little program in Mathematica to find out how large ones vocabulary is...
Cheers,
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
Thank you Marco, that is a great help. And thank you everyone.