Efficient Vectorization of For Loop
Mostrar comentarios más antiguos
Hi,
I have three matrices
and C and am trying to compute a fourth matrix Min the following way:
for p = 1:N
for q = 1:N
M(p,q) = 2 * sum(A(:,q) .* conj(B(:,p)) .* C(:,q));
end
end
All matrices are
. I am trying to compute this for N = 750 or so and the computation is extremely slow. I cannot find any obvious way to vectorize the code. Any help would be very much appreciated.
Thanks.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating and Concatenating 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!