I have a loop that runs millions of times that cannot be arrayed. Using the profiler I've noticed some of the lines that take up the most time are the end statements. Are there any ways to make the end statement of the for loop more efficient such as preallocation of single variables or clearing variables before the end of a loop?
MATLAB: Optimize the end statement in a for loop
for loopperformance
Best Answer