I want to find the inverse of an upper triangular matrix in an efficient way. I googled a lot, but all the articles discussed about a lower triangular matrix.

Is it possible to edit the matlab code in this answer so that its suitable for an upper triangular matrix? https://stackoverflow.com/a/12240951/919177

  • 1
    $\begingroup$ The transpose of an upper triangular matrix is lower triangular. This should help you. $\endgroup$ – J.R. Oct 12 '15 at 9:45
  • $\begingroup$ I think matlab's backslash operator will automatically make use of the upper triangular structure. Why not just use backslash? But note that if you want to write your own solver, you can use back substitution to solve an upper triangular system. You know the last component of $ x$ immediately, and that's a good start. $\endgroup$ – littleO Oct 12 '15 at 9:51
  • $\begingroup$ I guess I will just use the transpose on the forward substitution code given in the link. Thanks everyone. $\endgroup$ – vipin Oct 12 '15 at 10:32

If you really want to find the inverse $M$ of an invertible upper triangular matrix $U$, note that $U M = I \implies M^T U^T = I$, which shows that $M^T$ is the inverse of the lower triangular matrix $U^T$.

So, you can find $M^T$ using the code you already have to invert a lower triangular matrix. This gives you $M$.

However, a rule of thumb is that you rarely want to compute the inverse of a matrix explicitly. If you ever need to solve $Ux = b$, you can just use back substitution.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.