
I was talking to my long-time colleague, Mike Croucher, who joined MathWorks team recently (yay!). About a bunch of interesting topics, some of which could be good fodder for a blog post. Today I want to talk about
for-loops.Table of Contents
Nested LoopsStraight-forward Loop Solution, Inner Loop RowsStraight-forward Loop Solution, Inner Loop ColumnsVectorized SolutionAnalysisOrder MattersYour Thoughts?Nested LoopsIn my old Fortran programming days (yes, long gone), I learned early on that my code ran faster if I arranged my nested for-loops optimally. In Fortran, if I were computing one element at a time in a matrix, it meant making sure I filled the elements sequentially, which meant looping over each row, 1
...
read more >>
More...