You could use ``cartesianmap`` to implicitly loop through all of the variables indices in the right order, but not sure if the end result would be any simpler than this.