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

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

0 votes

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 線形代数 in Help Center and File Exchange

Products

Release

R2022b

Asked:

on 11 Nov 2022

Edited:

on 11 Nov 2022

Community Treasure Hunt

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

Start Hunting!