On 12/31/2013 2:16 AM, Bruno Luong wrote: > B(ismember(A,B(:,1)),2:end)
That returns the rows in B for which the indices are found in A, not B, unfortunately, Bruno. It does get the first one correct as they're both in position 2, but then it returns fourth row, not first where the last element of A is found in first column of B...
The previously-posted solution which OP doesn't like of
gets the right rows but they're in order returned from A which isn't same order as in B.
A one-liner hasn't occurred to me on this one, yet anyway...best I've gotten is two--