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!