I want to solve $Mx=b$ where $M$ (concrete example below) is singular, but where I can arbitrarily set some $x_i=0$ .. in which case I believe there should be a unique solution for $x$? But how how do I obtain it? The concrete example I provide is a simple example but approach to solving will need to work for large matrices (working in Matlab).. I apologize if this turns out to be an elementary problem... it's troubling me.
$$ M= \begin{bmatrix} 2 & -1 & -1 \\ 1 & 0 & -1 \\ 1 & 1 & -2 \\ \end{bmatrix} $$ and $$ b=\begin{bmatrix} 2 \\ 0 \\ -2 \\ \end{bmatrix} $$
So $Mx =b$ has infinitely many solutions. One approach is that you could find the least norm solution by multiplying both sides by the pseudoinverse of $M$.