MATLAB Answers

George
0

does mldivision have any exceptions? I used it to solve an equation and the values I got were wrong.

Asked by George
on 14 Oct 2014
Latest activity Edited by Roger Stafford on 14 Oct 2014
I tried solving the 9x9 system of equations as shown below.
after solving for X, I wanted to crosscheck my values so i run the syntax A*X==B and I did not get true(or 1) for all the values in the comparison. When I calculated it manually, I got a different answer which seemed right after recalculating and crosschecking.
what could be the problem?

  0 Comments

Sign in to comment.

1 Answer

Answer by Roger Stafford on 14 Oct 2014
Edited by Roger Stafford on 14 Oct 2014

You mustn't use "==" to check your answers because that doesn't allow for round-off errors. I checked the answers you obtained and they are correct to within reasonable round-off errors, which means they are correct out to about the fourteenth or fifteenth decimal place. Try using 'format long' to compare them. That is all you can reasonably expect from your computer using double precision floating point numbers.
In point of fact some of the theoretical values are fractions that cannot be represented exactly on either a decimal or a binary computing system, so it is not difficult to imagine that A*X and B may not be precisely the same. They actually differ only out in the least significant few bit positions.

  0 Comments

Sign in to comment.