Y = inv(X)

`Y = inv(X)`

computes the inverse of square matrix `X`

.

`X^(-1)`

is equivalent to `inv(X)`

.
`x = A\b`

is computed differently than `x = inv(A)*b`

and is recommended for solving systems of linear equations

he backslash calculation is quicker and has less residual error by several orders of magnitude. The fact that err_inv and err_bs are both on the order of 1e-6 simply reflects the condition number of the matrix.

The behavior of this example is typical. Using A\b instead of inv(A)*b is two to three times faster, and produces residuals on the order of machine accuracy relative to the magnitude of the data.

https://fr.mathworks.com/help/matlab/ref/inv.html

### Like this:

Like Loading...

*Related*