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).
K = P * D * D' * P;
Why am I getting this warning?What will change if I use or do not use parentheses there?
Floating-point arithmetic is not associative. So in general, a * (b * c)it will not necessarily give the same result as (a * b) * c.
a * (b * c)
(a * b) * c
((P * D) * D') * P, , D * D', .
((P * D) * D') * P
D * D'
:
K = (K + K') / 2;
K, , P * (D * D') * P.
K
P * (D * D') * P
Edit: , , K , P . P ( ), , K . D * D'.
P