Matlab says the matrix is not symmetric

16 次查看(过去 30 天)
Hi!
I compute the following matrix: D = b'Ab, where A is a symmetric covariance matrix. D is high-dimensional and must be symmetric by definition.
But when I apply a functiion "issymmetric" to D, Matlab returns 0 meaning that it is not symmetric.
I guess the problem is the way Matlab handles calculations. But how to fix it and make sure that Matlab sees the symmetry of the matrix D?
Thank you in advance!

采纳的回答

John D'Errico
John D'Errico 2020-7-9
编辑:John D'Errico 2020-7-9
D = rand(100);
D = (D + D.')/2;
issymmetric(D)
ans =
logical
1

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by