I know that the answer is
But i need to get this in matrix form.
Can anyone help ?
I know that the answer is
But i need to get this in matrix form.
Can anyone help ?
A sum of products like $\sum_i a_i b_i$ is a particular kind of inner product. Inner products are often written as $\langle a,b\rangle$. When dealing specifically with Euclidean vectors, they may also be called a dot product and would then normally be written $a\cdot b$.
If you're working with matrices, you would more commonly write the dot product of the vectors as $a^\top b$. If you're asking how to translate the formula you have, this would leave you nothing to do but simple substitution, so I won't take it any further.
Note that $\frac{1}{c^\top d}$ could also be written as $(c^\top d)^{-1}$ and so $a^\top b/c^\top d$ could more suggestively (in the sense of suggesting the relevant generalization) be written as $(c^\top d)^{-1}(a^\top b)$.
If instead you want to consider the case of multiple regression rather than simple regression, your $x$ will not be a vector but a matrix. However, there's no indication that I can discern in your question that you're asking about multiple regression.