I have the following matrix with Dimensions[A] = {5}
. What is the easiest way to convert it to $8 \times 8$ matrix?
A = {{{1, 1, 1, 1, 1, 1, 1, 1}}, {{1, 3, 2, 8, 6, 5, 9, 2}},
{{1, 8, 9, 8, 2, 7, 7, 5}, {7, 9, 6, 1, 8, 7, 6, 3}},
{{2, 9, 5, 5, 1, 7, 9, 7}, {9, 4, 8, 3, 5, 6, 2, 6},
{1, 2, 5, 3, 3, 8, 5, 2}, {4, 4, 2, 3, 6, 8, 7, 7}},
{{6, 5, 9, 3, 3, 5, 8, 2}, {4, 1, 4, 7, 4, 4, 8, 2},
{4, 8, 8, 6, 6, 4, 6, 3}, {8, 4, 1, 6, 6, 3, 2, 1},
{4, 9, 6, 3, 6, 9, 5, 6}, {9, 2, 5, 8, 6, 3, 5, 6},
{4, 2, 2, 2, 2, 5, 8, 6}, {6, 2, 2, 6, 9, 9, 5, 2},
{6, 4, 7, 6, 8, 9, 1, 8}}};
ArrayReshape[Flatten[A], {8, 8}]; Dimensions[%]
gives{8,8}
but your original matrix has 136 entries, not 64? $\endgroup$Dimensions /@ A
evaluates to{{1, 8}, {1, 8}, {2, 8}, {4, 8}, {9, 8}}
andLength@Flatten@A
evaluates to136
Which64
elements are supposed to be in the final 8x8 matrix? $\endgroup$