Fix does work. You need to understand what you asked it to do.
A = [4 3 2 1;2 5 6 2;0 0 1 3;-1 -2 9 8];
0.361823361823362 -0.190883190883191 -0.168091168091168 0.0655270655270655
-0.153846153846154 0.230769230769231 0.307692307692308 -0.153846153846154
0.00854700854700855 0.0427350427350427 -0.350427350427351 0.11965811965812
-0.00284900284900285 -0.0142450142450142 0.45014245014245 -0.0398860398860399
Do you recognize the matrix inverse is NOT composed of integer values?
1 8.15320033709099e-17 5.55111512312578e-17 -3.46944695195361e-17
-1.12757025938492e-16 1 3.33066907387547e-16 9.71445146547012e-17
-3.46944695195361e-18 0 1 -1.38777878078145e-17
7.63278329429795e-17 9.71445146547012e-17 -4.44089209850063e-16 1
The resulting product is NOT identically an identity matrix. That is exactly as expected. The deviations from an identity matrix are tiny, errors in the least significant bits.
So C(1,1) is not exactly 1. In fact, it is just a tiny bit less than 1. Close to 1 is not exactly 1. For example:
Is the result an identity matrix? It should be effectively so, if A was of full rank.
Again, all completely expected.
Since A is composed of integers, and A is of full rank, you could do this:
[127/351, -67/351, -59/351, 23/351]
[ -2/13, 3/13, 4/13, -2/13]
[ 1/117, 5/117, -41/117, 14/117]
[ -1/351, -5/351, 158/351, -14/351]
The result is now an EXACT identity matrix, because Bs is also exact, which was possible because A was an integer matrix.
Note that symbolic inverses on large matrices will typically be massively computationally intensive.
Best Answer