Accelerating the pace of engineering and science

# Documentation

## Description

X = adjoint(A) returns the adjoint matrix X of A. The adjoint of a matrix A is the matrix X, such that A*X = det(A)*eye(n) = X*A, where n is the number of rows in A and eye(n) is the n-by-n identity matrix.

## Input Arguments

 A Symbolic square matrix.

## Output Arguments

 X Symbolic square matrix of the same size as A.

## Examples

Compute the adjoint of this symbolic matrix:

```syms x y z
A = sym([x y z; 2 1 0; 1 0 2]);
```X =
[  2,    -2*y,      -z]
[ -4, 2*x - z,     2*z]
[ -1,       y, x - 2*y]```

Verify that A*X = det(A)*eye(3), where eye(3) is the 3-by-3 identity matrix:

`isAlways(A*X == det(A)*eye(3))`
```ans =
1     1     1
1     1     1
1     1     1```

Also verify that det(A)*eye(3) = X*A:

`isAlways(det(A)*eye(3) == X*A)`
```ans =
1     1     1
1     1     1
1     1     1```

Compute the inverse of this matrix by computing its adjoint and determinant:

```syms a b c d
A = [a b; c d];
```invA =
[  d/(a*d - b*c), -b/(a*d - b*c)]
[ -c/(a*d - b*c),  a/(a*d - b*c)]```

Verify that invA is the inverse of A:

`isAlways(invA == inv(A))`
```ans =
1     1
1     1```

expand all

### Adjoint of a Square Matrix

The adjoint of a square matrix A is the square matrix X, such that the (i,j)-th entry of X is the (j,i)-th cofactor of A.

### Cofactor of a Matrix

The (j,i)-th cofactor of A is defined as

${a}_{ji}{}^{\prime }={\left(-1\right)}^{i+j}\mathrm{det}\left({A}_{ij}\right)$

Aij is the submatrix of A obtained from A by removing the i-th row and j-th column.