How can I extract only the diagonal elements of a matrix product without computing the whole product matrix?
Mostrar comentarios más antiguos
I have nxk matrix (A) and a kxk (B) matrix where n>>k. I want the diagonal terms of A*B*A' in a n-vector. It would be wasteful to compute the whole A*B*A' and then extract the diagonal vector. What is the easy and efficient way to do this?
Thanks.
2 comentarios
Cedric
el 12 de Jun. de 2014
How large are n and k?
Ranjan Sonalkar
el 12 de Jun. de 2014
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Operating on Diagonal Matrices en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!