Compute the inverse of the square matrix A.
Return an estimate of the reciprocal condition number if requested, otherwise warn of an ill-conditioned matrix if the reciprocal condition number is small.
In general it is best to avoid calculating the inverse of a matrix directly.
For example, it is both faster and more accurate to solve systems of
equations (A*x = b) with
y = A \ b
, rather than
y = inv (A) * b
.
If called with a sparse matrix, then in general x will be a full matrix requiring significantly more storage. Avoid forming the inverse of a sparse matrix if possible.
inverse
is an alias and may be used identically in place of inv
.
See also: ldivide, rdivide, pinv.
Package: communications