Using Matlab's det(), why does this 3x3 matrix's determinant not zero?
Show older comments
x= [1 2 3;4 5 6;7 8 9]; det(x)
ans = 6.6613e-16
That 3x3 matrix is shown in various linear algebra books to give an example of a matrix where the determinant is zero. You can check the calculation from Wolframalpha's page .

However, when I use Matlab (from old versions to 64-bit 2017b) on a 64-bit Windows 10 machine, I always got a non-zero value.
Is this some kind of a bug or is this a problem shown from the "det()" function's calculation method?
I really want to know why Matlab gives a non-zero value.
-Regards, Matthew
2 Comments
Geoff Hayes
on 8 Feb 2018
Matthew - see http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F for a explanation of why you are getting a very small but non-zero answer.
Rudolf Fruehwirth
on 23 Apr 2021
This explanation doesn't hold water for an integer matrix.
Accepted Answer
More Answers (0)
Categories
Find more on Matrix and Vector Construction in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!