ismembc2
ISMEMBC2 Index of A within a sorted set (MATLAB compat).
LOC = ISMEMBC2 (A, S) returns, for each element of A, the index in S at which it occurs, or 0 when it does not occur. Where a value is repeated in S, MATLAB reports the *last* of those positions, which is what this returns too – ismember () would give the first.
Like ismembc (), this is an undocumented MATLAB helper that shipping code nonetheless calls; see the note in ismembc.m. S is expected sorted ascending with no NaN.