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

Rik
Rik 2019년 3월 5일
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).
Matt J
Matt J 2019년 3월 5일
편집: Matt J 2019년 3월 5일
Out of curiousity, what is the result of
prod(eig([0,0.5;-0.8,-0.5]))
in R2014a?
Walter Roberson
Walter Roberson 2019년 3월 5일
(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...
Alex Mcaulley
Alex Mcaulley 2019년 3월 6일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2019년 3월 5일

댓글:

2019년 3월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by