matrix transpose multiplication precision
Mostrar comentarios más antiguos
Hi everyone,
Forgive me if this is a stupid question. Is there a loss of precision when Matlab calculates the multiplication of the transpose of a matrix and itself?
for example, set variable q to a 2d matrix of size 6x6 with value 0.9 for each element. The result of q'*q is different than (q+0)'*q.
if true
% code
q = .9*ones(6,6);
norm((q+0)'*q - q'*q)
end
returns:
ans =
5.3291e-015
However a 5x5 matrix is alright:
if true
% code
q = .9*ones(5,5);
norm((q+0)'*q - q'*q)
end
A "whos" of q reveals:
whos qq Name Size Bytes Class Attributes
qq 6x6 288 double
Thanks, Afro
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!