This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Test a matrix for positive definiteness

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.




linalg::isPosDef(A) checks whether the matrix A is positive definite, so that for arbitrary vectors .

The component ring of A must be a field, i.e., a domain of category Cat::Field.

An error message is returned, if a result of an intermediate computation cannot be checked for being positive (which could happen, for example, if components of A are symbolic).

Environment Interactions

Properties of identifiers are taken into account.


Example 1

Here is an example of a positive definite matrix:

MatR := Dom::Matrix( Dom::Real ):
A := MatR([[14, 6, 9], [6, 17, -4], [9, -4, 13]])


The following matrix is not positive definite:

B := MatR([[1, 2, 3], [2, 3, 4], [5, 6, 7]])


Example 2

linalg::isPosDef in general does not work for matrices with symbolic entries. It may respond with an error message (because the system in general cannot decide whether a symbolic component is positive), such as for the following matrix:

delete a, b:
C := matrix([[a, b], [b, a]])

Error: Unable to check whether the matrix component is positive. [linalg::factorCholesky]

However, properties of identifiers are taken into account, so that, for example, linalg::isPosDef is able to perform the test correctly for the following matrix:

assume(a > 1): C := matrix([[a, 1], [1, a]]):

Note that such computations depend on the power of the underlying property mechanism implemented in the property library.



A matrix of a domain of category Cat::Matrix

Return Values

Either TRUE or FALSE.

Was this topic helpful?