Why does chol([4, -4;-4, 4]) fail to produce an answer?
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Paul Mellor
il 22 Dic 2015
Commentato: Paul Mellor
il 22 Dic 2015
>> chol([4, -4;-4, 4])
Error using chol
Matrix must be positive definite.
Yet clearly
R = [2, -2];
R' * R
Gives ans =
4 -4
-4 4
0 Commenti
Risposta accettata
Stephen23
il 22 Dic 2015
Modificato: Stephen23
il 22 Dic 2015
" [R,p] = chol(A) for positive definite A, produces an upper triangular matrix R from the diagonal and upper triangle of matrix A, satisfying the equation R'*R=A and p is zero. If A is not positive definite, then p is a positive integer and MATLAB® does not generate an error."
Lets try it:
>> [~,p] = chol([4, -4;-4, 4])
p =
2
This is the same method that TMW gives here:
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Linear Algebra in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!