Is there an operation (or a series of them) you can perform on a matrix which simply squares every element in the matrix?
You don't need to know what I'm trying to do to answer my question, but if you are interested:
I'm trying to understand the vectorized form of the cost function. It is: 
The unvectorized form of the cost function is:
$$J(\theta) = \frac{1}{2m}\sum (\theta_0x^i_0 + \theta_1x^i_1 + ...+\theta_nx^i_n-y^i)^2 $$
Where i is the i-th training example. If you don't know what that means, just know that $\theta$ is an $n$ x $1$ vector and $x^i_n$ is the element in the $i$-th row and $n$-th column of an $m$ x $n$ matrix $X$.
You can see how multiplying $X$ by $\theta$ gives you the result inside of the brackets within the summation, but my confusion is with how that sum inside the brackets is squared.
The vectorized form of the cost function seems to perform the squaring step by right-multiplying the matrix with it's transpose, and I do not see how that step achieves the effect of squaring every element.
Any help is appreciated!