Multiplication of very large matrix
Mostrar comentarios más antiguos
Hello everyone,
Could anyone help me in re-writing the following equation to make the processing faster. N here is the number of points and it could be 50,000. D is a diagonal matrix where only the diagonal contains values and the other elements are zeros.
M=eye(N)-((1./max((ones(N)'*D*ones(N)),eps))*(ones(N)*ones(N)'*D));
8 comentarios
Rik
el 13 de Dic. de 2020
Why do you have all those multiplications with ones(N) in there? Most of them don't actually do anything.
Can you confirm D is N by N?
MA
el 13 de Dic. de 2020
David Hill
el 13 de Dic. de 2020
Looks like just:
M=eye(N)-1./D^2;
Jan
el 13 de Dic. de 2020
I'm curious also about the multiplications with ones() . The purpose of transposing a ones() is magic also.
Please post some realistic test data, such that the reader have a chance to understand, what you are calculating.
MA
el 14 de Dic. de 2020
David Goodmanson
el 14 de Dic. de 2020
Hi MA,
for those of us not in IEEE, the reference is not of much help. The
(ones(N)*ones(N)'*D))
factor is in the numerator of the rhs, is that correct? Also, what is meant by ones(N)? In Matlab it's an NxN matrix, but in context it makes at least as much sense if it were an Nx1 column vector.
MA
el 14 de Dic. de 2020
MA
el 14 de Dic. de 2020
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Operating on Diagonal Matrices 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!