特異行列の逆行列の求め方

32 views (last 30 days)
Daichi
Daichi on 11 Nov 2022
Edited: Atsushi Ueno on 11 Nov 2022
A = [1,0,1;0,1,0;0,0,0]
のような特異行列には
B = [0.5,0,0;0,1.0,0;0.5,0,0]
といった疑似逆行列が存在するものの、matlabでinv等を使って求めようとすると「inf」とでてしまい計算できない。
どうしたら計算できるようになるのか教えていただきたいです。

Accepted Answer

Atsushi Ueno
Atsushi Ueno on 11 Nov 2022
A = [1,0,1;0,1,0;0,0,0] % 特異行列
A = 3×3
1 0 1 0 1 0 0 0 0
inv(A) % inv等を使って求めようとすると「inf」とでてしまい計算できない
Warning: Matrix is singular to working precision.
ans = 3×3
Inf Inf Inf 0 Inf Inf 0 0 Inf
B = pinv(A) % pinv等を使うと、期待する疑似逆行列を計算できる
B = 3×3
0.5000 0 0 0 1.0000 0 0.5000 0 0

More Answers (0)

Categories

Find more on Operating on Diagonal Matrices in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!