Solving for vector in linear algebra This is not really my field so please bear with me. In the equation:
$ (X^TX)\hat{h}_q = X^Ty_q $
I need to find the vector $\hat{h}_q$. $X$ and $y_q$ are known, and $y_q$ is the same length as $\hat{h}_q$.
$X$ is a matrix of the form:
$$X = \begin{pmatrix} 1 & 0 & 0 &0 \\ 2&1&0&0\\3&2&1&0\\4&3&2&1\\0&4&3&2\\0&0&4&3\\0&0&0&4\end{pmatrix}$$
but instead of 1 - 4 it's a vector of random numbers about 3500 long.

$h_q = (X^TX)^{-1}X^Ty_q$. Use matlab or octave to find $X^TX$ and its inverse. 
