how to vectorize this for loops?
1 回表示 (過去 30 日間)
古いコメントを表示
4 件のコメント
Jan
2018 年 1 月 10 日
By the way:
% Simpler:
% sigma0 * sqrt(2) ^ (1/level) ^ ((i-1)*level+j)
sigma0 * sqrt(2) ^ (i - 1 + j / level)
With a proper indentation the code looks cleaner: Ctrl-A Ctrl-I
回答 (1 件)
Jan
2018 年 1 月 10 日
Neither the inner nor the outer loop can be vectorized. The two imshow commands are impossible to vectorize. Do you really need them? Do you want a vectorization to increase the speed? Then start with using the profiler to find the most time consuming part of the code.
3 件のコメント
Jan
2018 年 1 月 10 日
What do you want to implement on GPU exactly? imshow, subplot, fspecial are not suitable for this, but conv2 will be fine.
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!