The SUB2NDX function converts the subscripts of a matrix into indices. This function is part of the IMLMLIB library of modules.