I multiply all your array by 10000, so every inputs are integers
P = [9871 0027; 0129 9973];
A = P - 10000*eye(2);
B = [A [0;0]];
rref(B)
Q = [-0129 0027; 0129 -0027];
rref([Q [0;0]])
ans =
1.0000 -0.2093 0
0 0 0
ans =
1.0000 -0.2093 0
0 0 0
Now both agree (of course they are now identical when RREF is invoked).
I show you the result are correct by transforming B.
>> C=B/-129
C =
1.0000 -0.2093 0
-1.0000 0.2093 0
>> C(2,:)=C(2,:)+C(1,:)
C =
1.0000 -0.2093 0
0 0 0
Why you get different results? MATLAB RREF is anything but a serious, it uses rational approximation and fails miserably on floating points. Student is advised to use pencil+paper if not they might fail the exam.
Best Answer