A_inverse*A=Identity Matrix in Octave? -
this question has answer here:
if nxn matrix, in octave, pinv(a) represent inverse of a. pinv(a)*a should yield identity matrix i(n). following code not working.
a=[ 1 2 3, 4 5 6, 7 8 9]; pinv(a)*a 0.83333 0.33333 -0.16667 0.33333 0.33333 0.33333 -0.16667 0.33333 0.83333
the diagonal elements , (pinv(a)*(a))[i,i] i=1,2,3 not near one.what went wrong?
try use inv(a) function , useful information:
>> inv(a) warning: matrix singular machine precision, rcond = 1.54198e-018
matrix not invertible! singular. try change matrix a:
>> a=[ 10 2 3; 4 5 6; 7 8 9] = 10 2 3 4 5 6 7 8 9 >> inv(a)*a ans = 1.00000 0.00000 0.00000 -0.00000 1.00000 0.00000 0.00000 0.00000 1.00000 >> pinv(a)*a ans = 1.0000e+000 -2.2204e-016 -4.4409e-016 -1.7764e-015 1.0000e+000 -3.5527e-015 5.3291e-015 5.3291e-015 1.0000e+000
Comments
Post a Comment