pinv
Pseudo-inverse of a matrix.
X=pinv(A)
X=pinv(A,tol)
Inputs
A Any real matrix.
tol A small positive real number used to specify that any singular values of A that are less than tol should be deemed to be zero.
Outputs
X The pseudo inverse of A .


Description
The pseudo inverse is defined to be the matrix that satisfies X*A*X=X and A*X*A=A even though A may not be invertible.
Example
>>a=[1 2 3;4 5 6;7 8 9]
>>inv(a)
Error Matrix may be singular

	Line 9 in inv

 in \Main
Error in call to inv
>>b=pinv(a)
>>a*b*a-a
Scaled by 10^-14
      -0.1332      -0.0888      -0.1332
       -0.222      -0.3553      -0.3553
      -0.5329      -0.7105      -0.8882

>>b*a*b-b
Scaled by 10^-15
      -0.6661      -0.1943       0.2776
       -0.118      -0.0243       0.0278
       0.4441        0.111       -0.222