ASA172 is a MATLAB library which simulates the behavior of a nested set of FORTRAN Do-Loops in generating all multidimensional indices in a given range.
ASA172 is Applied Statistics Algorithm 172. Source code for many Applied Statistics Algorithms is available through STATLIB.
ASA172 is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version.
You can go up one level to the MATLAB source codes.