M-Lint has detected a call to inv in a multiplication operation.
The inverse of a matrix is primarily of theoretical value, and rarely finds any use in practical computations. Never use it to solve a linear system Ax=b with x=inv(A)*b, because it is slow and inaccurate.
Suggested Action
Instead of multiplying the matrix by its inverse, use matrix right division (/) or matrix left division (\). That is:
Replace inv(A)*b with A\b
Replace b*inv(A) with b/A
Frequently, an application needs to solve a series of related linear systems Ax=b, where A does not change, but b does. In this case, use lu, chol, or qr instead of inv, depending on the matrix type.
Showing posts with label Matlab. Show all posts
Showing posts with label Matlab. Show all posts
Friday, May 1, 2009
Subscribe to:
Posts (Atom)
