Search code examples
wolfram-mathematica

How to multiply Column vector by Row vector in Mathematica?


I want to multiply every value in a column vector by the same vector but transposed to row. The output should be a multiplication table matrix. Like the third example in this picture.

I tried multiplying a column vector by its transposed form but Mathematica only gives me this which is not a Matrix.


Solution

  • Bryan,

    You need to use Dot, not Times. See docs.

    m = {{a}, {b}, {c}}
    m.Transpose[m]
    

    {{a^2, a b, a c}, {a b, b^2, b c}, {a c, b c, c^2}}