If I type into Mathematica
It gives me a result that has nested matrices. How do I turn that into a normal matrix without any nesting? Thanks
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.Sign up to join this community
An alternative approach is to use
KroneckerProduct which does not require flattening.
From the docs on TensorProduct:
KroneckerProductof matrices is equivalent to the flattening of their
TensorProductto another matrix.
That is, for any two matrices
KroneckerProduct[m1, m2] == ArrayFlatten[TensorProduct[m1, m2]] (* True *)
m1 = IdentityMatrix; KroneckerProduct[m1, m1] == ArrayFlatten[TensorProduct[m1, m1]] (* True *)