What is the matrix-vector product?
The matrix-vector product takes an m×n matrix A and an n-dimensional column vector x and produces a new m-dimensional column vector \(c = A\cdot x\). It is one of the most fundamental operations in linear algebra, underlying linear transformations, systems of equations, computer graphics, and machine learning. This calculator works with real numbers and applies everywhere — it is pure mathematics with no region-specific rules.
How to use this calculator
Enter the number of rows (i) and columns (j) of matrix A. Type the matrix entries in the grid box, one matrix row per line with values separated by spaces or commas. Enter the vector x with one value per token; its length must equal the number of columns of A. Blank cells are treated as 0. Press calculate to see the resulting column vector.
The formula explained
For each output index i from 1 to m (the number of rows), the result component is the weighted sum of the matrix entries in row i against the vector components:
$$c_i = a_{i1}\cdot x_1 + a_{i2}\cdot x_2 + \cdots + a_{in}\cdot x_n$$
This is simply the dot product of the i-th row of A with x. The multiplication is only defined when the columns of A match the length of x (cols = n). The output vector then has length m, the number of rows of A.
Worked example
Let A be the 3×3 matrix with rows [1 2 3], [4 5 6], [7 8 9] and \(x = (1, 0, -1)\). Then $$c_1 = 1\cdot 1 + 2\cdot 0 + 3\cdot(-1) = -2,$$ $$c_2 = 4\cdot 1 + 5\cdot 0 + 6\cdot(-1) = -2,$$ $$c_3 = 7\cdot 1 + 8\cdot 0 + 9\cdot(-1) = -2.$$ The result is the column vector \(c = (-2, -2, -2)\).
FAQ
What if the dimensions do not match? If the number of columns of A is not equal to the length of x, the product is undefined and the calculator shows a validation message instead of a number.
Can A be non-square? Yes. A 2×3 matrix times a 3-vector gives a 2-vector. The output length always equals the number of rows of A.
What does a 1×n matrix give? A 1×n matrix times an n-vector yields a single component — effectively the inner (dot) product of two vectors, shown here as a length-1 vector.