Borrar filtros
Borrar filtros

How to create positive semidefinite matrix from random value ?

36 visualizaciones (últimos 30 días)
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?

Respuesta aceptada

Walter Roberson
Walter Roberson el 8 de En. de 2021
A = rand(50);
A = 0.5 *(A+A');
issymmetric(A)
ans = logical
1
d = eig(A)
d = 50×1
-2.6403 -2.3499 -2.3084 -2.1472 -2.0568 -1.9520 -1.8574 -1.5880 -1.5540 -1.4120
all(imag(d) == 0 & d >= 0)
ans = logical
0
APos = A'*A;
issymmetric(APos)
ans = logical
1
d = eig(APos)
d = 50×1
0.0000 0.0048 0.0360 0.0436 0.0506 0.0978 0.1031 0.1715 0.1725 0.1929
all(imag(d) == 0 & d >= 0)
ans = logical
1

Más respuestas (0)

Categorías

Más información sobre Particle & Nuclear Physics en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by