I have a badly conditioned matrix, whose rcond() is close to zero, and therefore, the inverse of that matrix does not come out to be correct. I have tried using pinv() but that does not solve the problem. This is how I am taking the inverse:
X = (A)\(b);
I looked up for a solution to this problem and found this link (last solution) for improving the matrix. The solution there suggests to use this:
A_new = A_old + c*eye(size(A_old));
Where c > 0. So far employing this technique works in making the matrix A better conditioned and the resultant solution looks better. However, I investigated using different values of c and the resultant solution depends on the value of chosen c. 
Other than manually investigating for the value of c, is there an automatic way through which I can find the value of c for which I get the best solution?
 
     
     
    