- https://www.mathworks.com/help/matlab/ref/chol.html
- https://www.mathworks.com/help/matlab/ref/cholupdate.html?searchHighlight=cholupdate&s_tid=srchtitle_support_results_1_cholupdate
Numerical issues with UKF and SR-UKF
조회 수: 12 (최근 30일)
이전 댓글 표시
Error using cholupdate
Downdated matrix must be positive definite.
Error in Copy_2_of_UKF_Case1 (line 311)
S{k} = cholupdate((Sm{k}),U(:,i),'-');
댓글 수: 0
답변 (1개)
Vinay
2024년 8월 13일
Hii Oussama ,
The “chol” function in the MATLAB does the Cholesky factorization of the matrix. The matrix must be symmetric positive definite for Cholesky factorization, but in the code the matrix “Rx” is not symmetric positive definite causing the error in factorization.
Sm{k} = cholupdate(Rx,Wc(1)*(xhi{k}(:,1)-xhm{k}),'-')';
The flag output of the “chol” function indicates the index of the pivot position where the factorization failed.
% flag to check the position where pivot failed
[R,flag] = chol(Rx)
The following function check whether matrix is positive definite.
try chol(Rx)
disp('Matrix is symmetric positive definite.')
catch ME
disp('Matrix is not symmetric positive definite')
end
The error is due to the "Rx" matrix which is not symmetric positive definite causing error in the "Sm{K}" calculation
You can refer to the following documentations for “chol” and “cholupdate”:
I hope this helps!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!