I have a question regarding the efficiency of accessing arrays in matlab. Below you can see a screenshot taken from profiler. I thought it was a little bit surprising that lines 22-23 takes a fraction of lines 26-27. I realize that I am accessing more element of the array, however I would not expect the difference to be this much.
I would be glad if you could advise me on any methods or tricks which could be helpful to improve the efficiency?