Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose you have a matrix $A =\begin{bmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{bmatrix}$ and $B = [1,2]$. I want to multiply the matrices together so I get a $3 \times 1$ resulting matrix where each entry is equal to $1*a1 + 2*a2$. How would I do this? The number of columns in matrix in matrix A is not the same as the number of rows in matrix B so I am not sure what to do.

share|cite|improve this question
You sure ly want $B$ to be a column, not a row, vector. – 1015 Apr 19 '13 at 21:22
up vote 2 down vote accepted

If $A$ is a $m\times n$ and $B$ is a $j\times k$ matrix, then multiplication $AB$ is only defined when $n=j$, and the result will be an $m\times k$ matrix.

You could modify the example you have by transposing one of the matrices. For example, $AB^T$ is defined, and $BA^T$ is defined. The former would be a $3\times 1$ and the latter would be a $1\times 3$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.