How to do the following projection in Matlab?

3.1k Views Asked by At

I have 2 vectors $u$ and $v$ given in $\mathbb R^4$, e.g. $u = (-1,-2,3,4)$ and $v=(1,-2,-3,5)$
I also have $Ax=b$ which is an under-determined system; meaning, if $A$ is $m\times n$, then $m\le n$.

We define a 2 dimensional plane as follows $K=\{x\in \mathbb R^4:\, u^Tx = 1,\,v^Tx = 1\}$.

I need to find the projection of some point $z = (1,2,2,1)$ on $K$ plane by formulating a least-norm problem.

I know that I can use $x=A'(AA')^{-1}\setminus b$ this formula to solve the least-norm problem.

Thanks

2

There are 2 best solutions below

0
On BEST ANSWER

Let $x = \text{proj}_K(z) - z$. Then $x$ is the vector of least norm such that $z + x$ belongs to $K$. You can now find a least norm solution to the system of two equations that must be satisfied by $x$.

2
On

Note that $K$ is equivalent to the solutions $x$ of $Ax=\begin{bmatrix}1\\1\end{bmatrix}$, where $A=\begin{bmatrix}u^T\\v^T\end{bmatrix}$.

$x$ can then be calculated in MATLAB with

x=A/b

This will be the projection onto the plane, with $b$ defined as $b=[1,1]^T$.