can i do inverse for array in matlab using for ? how ?
Mostrar comentarios más antiguos
x=[1 2 3; 4 5 6; 7 8 9]
1 comentario
Walter Roberson
el 18 de Oct. de 2022
you could program cofactor expansion
Respuestas (1)
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 comentarios
John D'Errico
el 18 de Oct. de 2022
Note that using det to detemine if a matrix singular is just a bad idea. Use tools like rank, or cond instead.
3lewwi
el 18 de Oct. de 2022
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!