can i do inverse for array in matlab using for ? how ?
1 回表示 (過去 30 日間)
古いコメントを表示
x=[1 2 3; 4 5 6; 7 8 9]
回答 (1 件)
David Hill
2022 年 10 月 18 日
If det(x) ~=0, then matrix is invertable.Your matrix above is not.
x=[1 2 3; 4 5 6; 7 8 -1];
det(x)
r=rref([x,eye(size(x))]);
Xinv=r(1:3,4:6)
x*Xinv
Xinv*x
2 件のコメント
John D'Errico
2022 年 10 月 18 日
Note that using det to detemine if a matrix singular is just a bad idea. Use tools like rank, or cond instead.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!