I have four matrices
m = {{M11, M12, M13}, {M21, M22, M23}, {M31, M32, M33}};
n = {{N11, N12, N13}, {N21, N22, N23}, {N31, N32, N33}};
p = {{P11, P12, P13}, {P21, P22, P23}, {P31, P32, P33}};
q = {{Q11, Q12, Q13}, {Q21, Q22, Q23}, {Q31, Q32, Q33}};
and i want to construct the following
ArrayFlatten[Table[{{m[[k1, k2]], n[[k1, k2]]}, {p[[k1, k2]], q[[k1, k2]]}}, {k1,1, 3}, {k2, 1, 3}]]
{{M11, N11, M12, N12, M13, N13},
{P11, Q11, P12, Q12, P13, Q13},
{M21, N21, M22, N22, M23, N23},
{P21, Q21, P22, Q22, P23, Q23},
{M31, N31, M32, N32, M33, N33},
{P31, Q31, P32, Q32, P33, Q33}}
There is a more elegant and rapid way to this thing?
ArrayFlatten@Transpose[{{m, n}, {p, q}}, {3, 4, 1, 2}]
$\endgroup$Flatten[]
andTranspose[]
, Carl's and Simon's snippets are equivalent. $\endgroup$