Testing positive definiteness of a symmetric matrix: isposdef

### 5.47.16 Testing positive definiteness of a symmetric matrix: isposdef

The isposdef command checks whether the given symmetric matrix A∈ℝn× n is positive definite, i.e. whether xTAx>0 for all vectors x∈ℝn.

isposdef takes a symmetric matrix A as its only argument and returns 1 if A is positive definite and 0 otherwise. Note that this procedure does not check whether A is symmetric.

#### Example.

- Input:
  isposdef([[1,-1,2],[-1,4,3],[2,3,-5]])
- Output:

  1

- Input:
  isposdef([[1,-1,2],[-1,-2,3],[2,3,-5]])
- Output:

  0