how to vectorize this for loops?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/168657/image.png)
4 comentarios
Siddhesh Karbhari
el 10 de En. de 2018
Editada: per isakson
el 13 de En. de 2018
Jan
el 10 de En. de 2018
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
Respuestas (1)
Jan
el 10 de En. de 2018
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 comentarios
Jan
el 10 de En. de 2018
What do you want to implement on GPU exactly? imshow, subplot, fspecial are not suitable for this, but conv2 will be fine.
Ver también
Categorías
Más información sobre Environment and Settings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!