Clear Filters
Clear Filters

How to implement a multiple nested "nested loop" faster in MATLAB

4 views (last 30 days)
I want to implement the following formula in MATLAB. This formula represents point spread function(PSF) from concentrating point to grid point :
I have to implement this formula multiple time in MATLAB. So, running speed is very important to me. and are vectors with 40000 elements (albeit, we can represent and in 2D format) . Also, is a vector with 1400 elements and has 51 elements. For each , we have to sum over all and and also, over all (because we want to calculate PSF from to all grid points ). Also we want to implment this PSF for all . in the worst implementation, we have 4 for-loop with lots of elements. Definitely, it decrease speed by a huge amount. So, how can I avoid this?

Answers (0)


Find more on Loops and Conditional Statements in Help Center and File Exchange




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!