Dot product in matrix notation
The transpose of a matrix
Before describing the dot product in matrix notation, we briefly digress to make sure you know what the transpose of a matrix is.
We can transpose a matrix by switching its rows with its columns. We denote the transpose of matrix A by AT . For example, if
A = ![]() |
AT = . |
Since an n-dimensional vector x is represented by an n × 1 column matrix,
x = , |
xT = . |
The dot product as matrix multiplication
Given the rules of matrix multiplication, the product of a 1 × n matrix with an n× 1 matrix is a 1 × 1 matrix, i.e., a scalar. So if we multiply xT (a 1 ×n matrix) with any n-dimensional vector y (viewed as an n × 1 matrix), we end up with a matrix multiplication equivalent to the familiar dot product of x ⋅ y:
xT y = ![]() = x1y1 + x2y2 + x3y3 + … + xnyn = x ⋅ y. |
![[ ]
1 2 3
4 5 6](dotprodmat0x.png)


![[ x x x ⋅⋅⋅ x ]
1 2 3 n](dotprodmat3x.png)
![[ ]
x1 x2 x3 ⋅⋅⋅ xn](dotprodmat4x.png)
=