I'm trying to multiply a matrix 4x1 with a vector 1x4. I'm supposed to get a matrix 4x4. When I try to multiply both matrices I get an error, incompatible shapes. It doesn't make any sense because the shapes are compatible so probablyh I'm doing something wrong:
B = {{3619.3}, {3619.3}, {-29800}, {0}}
Cc = {0, 0, 0, 1}
B.Cc
Dot::dotsh: Tensors {{3619.3},{3619.3},{-29800},{0}} and {0,0,0,1} have incompatible shapes.
I tried doing similar multiplications but sometimes Matheamtica doesn't give any error but gives me wrong a answer which is worse. What Am I doing wrong?
Outer[Times, {3619.3, 3619.3, -29800, 0}, {0, 0, 0, 1}]
. $\endgroup$B . {Cc}
instead. $\endgroup${{3619.3}, {3619.3}, {-29800}, {0}}.{{0, 0, 0, 1}}
, which you might find more satisfying. Essentially to force Mathematica to think of it as a row vector, you have to make it a 1xn matrix. (Edit I now realize Carl Woll also said something similar above.) $\endgroup$