so i have a possibly singular coefficient matrix A . (it's sometimes singular and sometimes not !) (in the case of singularity it has many solutions we only need one)
i know using an inverse to find the answer to a system of linear equations is an awful idea .
so it seems even in this case we should use methods like Gauss-Jordan to solve the system even when it is singular . is there any method to solve singular systems like Gauss-Jordan.(to give a answer)
and i read the matlab document on solving this types of systems and it says that we should use the pseudo-inverse function pinv like : x = pinv(A)*b
this just looks as awful as taking the inverse (since for a non-singular matrix pseudo-inverse is same as inverse). (am I correct?)
and is it the case that we don't have any other more efficient choices of finding and answer in this case ??
It is not generally true that the pseudoinverse is the same as the inverse. In the case that a matrix is invertible, then they coincide. The pseudoinverse can be computed in different ways;
pinvin MATLAB is generally good at selecting the right algorithm for the job (typically something SVD-like).It's important to note that for a singular or otherwise ill-conditioned problem, the resulting value will not necessarily represent the solution, but rather the solution that minimizes the value $\| Ax-b\|$.