code: public static int ravelIndexMatlab(int[] indices, int[] dims) {
          indices = indices.clone();
          ArrayUtils.reverse(indices);
          dims = dims.clone();
          ArrayUtils.reverse(dims);
          return ravelIndex(indices, dims);
      }
docs: Gets the index into the values array that corresponds to the indices.