wolffd@0: function ndx = subv2indTest(siz,sub) wolffd@0: %SUBV2IND Linear index from subscript vector. wolffd@0: % SUBV2IND(SIZ,SUB) returns an equivalent single index corresponding to a wolffd@0: % subscript vector for an array of size SIZ. wolffd@0: % If SUB is a matrix, with subscript vectors as rows, then the result is a wolffd@0: % column vector. wolffd@0: % wolffd@0: % This is the opposite of IND2SUBV, so that wolffd@0: % SUBV2IND(SIZ,IND2SUBV(SIZ,IND)) == IND. wolffd@0: % wolffd@0: % See also IND2SUBV, SUB2IND. wolffd@0: wolffd@0: ndx = subv2indMinka(siz,sub); wolffd@0: ndx2 = subv2indKPM(siz,sub); wolffd@0: assert(isequalKPM(ndx,ndx2))