How to project a matrix e.g $$A = \begin{bmatrix}2& 5& 4\\ 3& 8& 9\\ 12& 11& 5\\ 4& -7 &8\end{bmatrix}$$ and get the vector_of_projected_points (VPP) onto the following:
- X and Y axis
- Principal component and a perpendicular line to it
- Some random/example lines so I can understand it better
I know that VPP = (P^T) * A , where P^T is the transpose of a projection vector(i also don't know how to compute one) that has ||P|| = 1 and has dx1 elements and A is my matrix which has dxd elements in this example 4$\times$3. I'm new to MATLAB so I would really appreciate your help! Thanks!
The projection of $v$ in the direction of $P$ involves both the scalar value (dot product, calculated as $P^T v$) and the direction. So, the final result should be
Note that $P$ here has length one. To get the length one, take your original vector and divide by its length. For example,
To project the matrix, you project every column of the matrix.