MATLAB: Mldivide difference between 2008b and 2015b

mldivide

Dear,
The same code i got different results between Matlab 2008b and 2015b !
P = A \ eye(size(A))
where A is 9 x 9 matrix
Any solution to work for both Matlab versions ?
thanks,
–Dan

Best Answer

Between those two versions there were multiple upgrades to the algorithms and to the LAPACK or BLAS libraries, and there have been additional upgrades since that time. Current versions are more likely to reject rank-deficient matrices that earlier versions permitted to slip by.
If you need bit-for-bit equivalent solutions, then you should be using symbolic computations, as floating point computations can be affected by what kind of CPU you have and which operating system and patch you have installed.
For any one system with particular hardware and with operating system upgrades frozen (e.g., you disconnected from the internet to prevent Microsoft from forcing an upgrade), then if you need bit-for-bit equivalent solutions and will never try to export or compare the answers to elsewhere, then you can download LAPACK source and compile it and call into it from MATLAB using loadlibrary()
I notice in a quick test that
output = A\eye(size(A))
appears to give the same result as
t = pinv(A); output = t(:,1:size(A,2));
but not bit-for-bit identical. But there is a possibility that it might be consistent between the two releases.