[See Speed MATLAB by optimizing memory access for tips on optimizing memory-bound code.] MATLAB is great tool for algorithm ...