Search code examples
matrixinverse

inverse of a matrix by gauss elimination method


How to find the inverse of a matrix? I am trying to use the Gauss elimination method. I know how to solve it by hand, but unable to understand how to code.


Solution

  • Guass-Jordan elimination is explained clearly here: http://www.codewithc.com/c-program-for-gauss-jordan-method/

    Also here is a C++ method implementation which is more aligned to finding the inverse of the matrix: http://www.sanfoundry.com/cpp-program-implement-gauss-jordan-elimination/

    Note, please attempt to understand the reasoning behind the method. If I were learning this topic, I may try to write the code from the description myself first, then only look at the coded solution if I got stuck.

    Also, there are likely other implementations in other languages - if you simply do a meaningful search on Google.

    Good luck!