How to find the inverse of a 2x2 matrix using gaussian elimination (not using rref or lu)?

1 回表示 (過去 30 日間)
John Staine
John Staine 2018 年 5 月 18 日
コメント済み: Jim Riggs 2018 年 5 月 18 日
Thanks

回答 (2 件)

Jim Riggs
Jim Riggs 2018 年 5 月 18 日
編集済み: Jim Riggs 2018 年 5 月 18 日
The inverse of a 2x2 is very easy to calculate:
In terms of Matlab code:
detA = A(1,1)*A(2,2)-A(1,2)*A(2,1);
Ainv = (1/detA)*[A(2,2),-A(1,2);-A(2,1),A(1,1)];
(note that if detA is zero, the matrix has no inverse)
  2 件のコメント
John Staine
John Staine 2018 年 5 月 18 日
And how would i code it so it uses Gaussian elimination process to find the inverse?
Jim Riggs
Jim Riggs 2018 年 5 月 18 日
Gaussian elimination is not needed unless the matrix rank is greater than 3. For rank 2 and 3 there is a closed-form solution which is more efficient.

サインインしてコメントする。


the cyclist
the cyclist 2018 年 5 月 18 日
I found this answer by googling.

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by