Which mldivide ('\') function is better

조회 수: 4 (최근 30일)
Dan NG
Dan NG 2018년 11월 29일
편집: Bruno Luong 2018년 12월 3일
Dear,
I have a 9x9 float matrix M, when I use it to \ function and got pretty much diferent result (P) between Matlab 2008 and 2015.
P = M \ eye(size(M))
My question is - Which one is better ? mldivide() in 2015 or mldivide() in 2008 Matlab version ? (suppose later is better ?)
Thanks,
--Dan

채택된 답변

Bruno Luong
Bruno Luong 2018년 12월 3일
편집: Bruno Luong 2018년 12월 3일
Use pseudo inverse PINV to get more stable solution. Never use "\" on nearly singular matrix. You are happy with 2008 is just pure luck.

추가 답변 (2개)

the cyclist
the cyclist 2018년 11월 29일
I highly doubt that a bug was found in mldivide later than 2008, so I doubt the later function is "more correct" or "more accurate". Instead, I suppose that there was some minor algorithmic change (e.g. some kind of time optimization).
How big is the difference between the two results? I'm guessing it is very small -- the order of normal floating point error -- such that the difference is down around the level of the overall accuracy of the calculation in the first place.
Can you upload the matrix M in a MAT file?

Dan NG
Dan NG 2018년 11월 29일
I have to type it for you.
the results differences about 1.0+e19 for each (if not zero)
  댓글 수: 3
Walter Roberson
Walter Roberson 2018년 11월 29일
Differences that big suggest that either you are working with values near 1E-20 or else that your matrix is nearly singular.
Dan NG
Dan NG 2018년 12월 3일
Yes, my matrix is nearly singular. So far I'm happy with results from MatLab 2008 but it is so different in 2015 MatLab. I try to find a solution without redo my 9x9 matrix.

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

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by