Warning: "Match the multiplication" D "and its transposition to ensure that the result is a hermetic."

enter image description here

As you can see in the screenshot above, I have the following expression in my Matlab file m file:
K = P * D * D' * P;
Where, P is the nxn matrix, and D is the column vector nx1 (n = 4, if that matters).

Why am I getting this warning?
What will change if I use or do not use parentheses there?

+3
source share
2 answers

Floating-point arithmetic is not associative. So in general, a * (b * c)it will not necessarily give the same result as (a * b) * c.

((P * D) * D') * P, , D * D', .

+5

:

K = (K + K') / 2;

K, , P * (D * D') * P.

Edit: , , K , P . P ( ), , K . D * D'.

+1

All Articles