(Matlab) How to find inverse using eig

In summary, the conversation discusses the use of the Matlab function 'eig' to find the inverse of a matrix. The speaker is struggling with this task and mentions a possible alternative method using the Cayley-Hamilton theorem. However, the solution is to use the eigendecomposition method, which involves using the eigenvalues and eigenvectors of the matrix. This can be found in notes or online resources.
  • #1
asynja
16
0
(Matlab) How to find inverse using "eig"

I'm doing a project for Numerical Methods and one of the questions is how to find an inverse of a (random) matrix using Matlab function 'eig'. I know the solution is probably simple, but I almost never used Matlab before, besides, lectures were horrible and notes aren't helping. Anyway, this question bothers me because I can't recall any analytical way of calculating inverse matrix using eigenvalues. There is a consequence of Cayley-Hamilton theorem, where you can find the inverse of A from its characteristic polynomial. But if this is what they're asking to do, then why use 'eig' in Matlab, when there's 'poly' ...
 
Physics news on Phys.org
  • #2
Last edited by a moderator:

FAQ: (Matlab) How to find inverse using eig

How do I find the inverse of a matrix in Matlab using eig?

To find the inverse of a matrix in Matlab using the eig function, you can use the following syntax:
inv(A) = V * diag(1./d) * U', where A is the matrix to be inverted, V is the matrix of eigenvectors, and d is the vector of eigenvalues.

Can I find the inverse of a non-square matrix using eig in Matlab?

No, the eig function in Matlab can only be used to find the inverse of a square matrix. If you try to use it on a non-square matrix, you will receive an error.

Is using eig the most efficient way to find the inverse of a matrix in Matlab?

No, there are other methods that can be more efficient for finding the inverse of a matrix in Matlab. The eig function can be computationally expensive for large matrices. You may want to consider using the built-in inv function or other specialized functions for inverting specific types of matrices.

How can I check if the inverse of my matrix is correct using eig in Matlab?

You can check the accuracy of the inverse matrix by multiplying it with the original matrix. If the result is an identity matrix, then the inverse is correct. For example, if A is the original matrix and B is its inverse, then A * B should give an identity matrix.

Can I use eig to find the inverse of a singular matrix in Matlab?

Yes, you can use eig to find the inverse of a singular matrix in Matlab. However, the inverse may not be accurate due to the presence of zero eigenvalues. It is recommended to use other methods specifically designed for inverting singular matrices.

Similar threads

Back
Top