How to create positive semidefinite matrix from random value ?
조회 수: 29 (최근 30일)
이전 댓글 표시
I form a matrix A in matlab as
A=rand(50);
I want to know how to make symmetric matrix using equation
A=0.5 *(A+A');
but how can I make it positive semidefinite matrix?
댓글 수: 0
채택된 답변
Walter Roberson
2021년 1월 8일
A = rand(50);
A = 0.5 *(A+A');
issymmetric(A)
d = eig(A)
all(imag(d) == 0 & d >= 0)
APos = A'*A;
issymmetric(APos)
d = eig(APos)
all(imag(d) == 0 & d >= 0)
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!