# multiply two vectors, component by component [closed]

Would like to take two vectors and multiply components at the same index.For example {a1, a2, a3} x {b1, b2, b3} to produce {a1 b1, a2 b2, a3 b3}. The following works, but are there some alternatives?

aMat = DiagonalMatrix[{a1, a2, a3}];
bMat = DiagonalMatrix[{b1, b2, b3}];
Diagonal @ Dot[aMat, bMat]
result: {a1 b1, a2 b2, a3 b3}


## closed as off-topic by m_goldberg, AccidentalFourierTransform, Michael E2, gwr, eyorbleSep 12 '18 at 21:02

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, AccidentalFourierTransform, Michael E2, gwr, eyorble
If this question can be reworded to fit the rules in the help center, please edit the question.

• {a1,a2,a3}*{b1,b2,b3} will give the required answer – mikado Sep 8 '18 at 19:22

## 1 Answer

No need to do anything fancy. This is just how ordinary list multiplication works:

{a1, a2, a3} {b1, b2, b3}


yields

{a1 b1, a2 b2, a3 b3}

• thanks! didn't even think to try that. – user6546 Sep 8 '18 at 19:25