English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

MATLAB Inverse Matrix

The inverse of matrix A is by A -1represents, so that the following relationship holds-

AA−1 = A−1A = 1

The inverse of a matrix is not always present. If the determinant of the matrix is zero, the inverse does not exist, and the matrix is singular.

The inv function can be used to calculate the inverse of a matrix in MATLAB. The inverse of matrix A is given by inv(A).

Online Example

Create a script file and enter the following code-

a = [ 1 2 3; 2 3 4; 1 2 5]
inv(a)

It displays the following result when the file is executed-

a =
   1     2     3
   2     3     4
   1     2     5
ans =
   -3.5000    2.0000    0.5000
   3.0000   -1.0000    -1.0000
   -0.5000      0       0.5000