Matlab 2014a bug with 2x2 determinant

>> det([0,-1;1,1])
ans =
-1
but it should be 1 !!!
This happens with Matlab R2014a on a Macbook Air from 2013, with Mojave OS.
Same sign error whenever the matrix has 0 as first entry. Another example :
>> det([0,0.5;-0.8,-0.5])
ans =
-0.4000
I could not find any report of this bug on the web (after only a quick search though...) Is this a known issue ?

7 Comments

Just to confirm: WolframAlpha link. It is not mentioned in the bug tracker, nor in the release notes. I can't reproduce this on R2015a or R2011a (Windows x64).
If you can reproduce this, you can file a bug report. I doubt Mathworks would release an update, as a long term supported and updated version is still not really there (even if there have been a few updates to non-latest versions).
Out of curiousity, what is the result of
prod(eig([0,0.5;-0.8,-0.5]))
in R2014a?
(Seems to be fixed by R2018b)
(Note that R2018b is the earliest MATLAB that is supported on Mojave)
product of eigenvalues is ok :
>> prod(eig([0,0.5;-0.8,-0.5]))
ans =
0.4000
So only the det is wrong...
It also works with R2016b
I just ran both commands in R2014a on my Linux machine, and got the right answers. So this is definitely OS-specific.
What outputs do you get if you pass these matrices into LU, like this?
[L, U, P] = lu(A);
Ok, good find ! In fact
A=[0,0.5;-0.8,-0.5];
[L, U, P] = lu(A);
makes Matlab crash with the message "MATLAB has encountered an internal problem and needs to close". But in fact this does not depend on this particular matrix, any call to the function lu with any matrix size does the same. So my Matlab is definitely broken in fact. I will try to reinstall it maybe it will solve the issue.
Thanks all for your answers.

Sign in to comment.

Answers (0)

Asked:

on 5 Mar 2019

Commented:

on 6 Mar 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!