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!