Efficient Vectorization of For Loop
古いコメントを表示
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.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!