MATLAB: The loss of precisions

invMATLABmatrix

hai , i applied the Least square adjustment in matlab:X=inv(N)*XA for your information , the value of X ,N and XA should be same with the value in the textbook. After computation , I had found that value of N and XA are same with the value in the book , but the X value is not same : 448.0686(from matlab) 448.1087(from book) 453.3532(from matlab) 453.4685(from book) 444.9608 (from matlab) 444.9436(from book) The X value is very importance for next step computation. If i not wrong , this is loss precision cause by inv. How to resolve this problem ?

Best Answer

If you read the documentation of inv
doc inv
In practice, it is seldom necessary to form the explicit inverse of a matrix. A frequent misuse of inv arises when solving the system of linear equations Ax = b. One way to solve this is with x = inv(A)*b. A better way, from both an execution time and numerical accuracy standpoint, is to use the matrix division operator x = A\b. This produces the solution using Gaussian elimination, without forming the inverse. See mldivide (\) for further information