MATLAB Answers

Matlab says the matrix is not symmetric

18 ビュー (過去 30 日間)
Elena
Elena 2020 年 7 月 9 日 16:44
コメント済み: Elena 2020 年 7 月 9 日 18:17
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!

  0 件のコメント

Sign in to comment.

採用された回答

John D'Errico
John D'Errico 2020 年 7 月 9 日 16:54
編集済み: John D'Errico 2020 年 7 月 9 日 16:55
D = rand(100);
D = (D + D.')/2;
issymmetric(D)
ans =
logical
1

  1 件のコメント

Elena
Elena 2020 年 7 月 9 日 18:17
Thanks a lot!

Sign in to comment.

その他の回答 (0 件)

タグ

製品


Translated by