Jump to navigation Jump to search
Determines whether or not a matrix is totally positive

Other toolboxes required none
Related functions IsTotallyNonsingular
Function category Miscellaneous

IsTotallyPositive is a function that determines whether or not a given matrix is totally positive (i.e., all of its square submatrices have positive determinant). The input matrix can be either full or sparse.


  • ITP = IsTotallyPositive(X)
  • ITP = IsTotallyPositive(X,SUB_SIZES)
  • ITP = IsTotallyPositive(X,SUB_SIZES,TOL)
  • [ITP,WIT] = IsTotallyPositive(X,SUB_SIZES,TOL)

Argument descriptions

Input arguments

  • X: A matrix.
  • SUB_SIZES (optional, default 1:min(size(X))): A vector specifying the sizes of submatrices to be checked to have positive determinant.
  • TOL (optional, default length(X)*eps(norm(X,'fro'))): The numerical tolerance used when determining positivity.

Output arguments

  • ITP: A flag (either 1 or 0) indicating that X is or is not totally positive.
  • WIT (optional): If ITP = 0 then WIT specifies a submatrix of X that has either negative or non-real determinant. More specifically, WIT is a matrix with 2 rows such that det(X(WIT(1,:),WIT(2,:))) is negative or non-real.


Vandermonde matrices

It is known that Vandermonde matrices are totally positive, under certain restrictions on the nodes:

>> IsTotallyPositive(vander(5:-1:1))

ans =



In practice, this function is practical for matrices of size up to about 15-by-15.

Source code

Click on "expand" to the right to view the MATLAB source code for this function.