I'm trying to create a certain 6x6 matrix using Mathematica's in-built "Table[]" function and have landed on
Table[Subscript[H, i, j, k, l], {i, {x, y, z}}, {j, {x, y, z}}, {k, 1,
2}, {l, 1, 2}] // MatrixForm
, which results in a 3x3 matrix with each entry corresponding to a 2x2 matrix. Instead, I actually want a plain 6x6 matrix with the same 36 entries, i.e. without the grouping into sub-matrices. How can I make this happen?
Similarly, how would I create a 6-dimensional column vector? Using "Table[]" results in two columns, e.g.
Table[Subscript[p, i, k], {i, {x, y, z}}, {k, 1, 2}] // MatrixForm
and "Array[]" does not take nested lists as argument. Without nesting I get the following error:


ArrayFlatten is needed when you have arrays inside an array which is not the case for your second example.
Nhas reserved meaning in Mathematica, I request you to modify your post. – Syed Oct 18 '23 at 05:19FullForm[n']and you will see that the prime mark cannot be used as part of a symbol name. It is used for differentiation. – Bob Hanlon Oct 18 '23 at 05:31n'withnp). – march Oct 18 '23 at 16:15Flatteninstead ofMatrixFlattenfor your second question. – bbgodfrey Oct 19 '23 at 13:57