MATLAB: Does something similar to ‘intersect’ command exists for more than 2 vectors

intersect

Hi,
There are 5 row vectors with different(or same) number of elements. The problem is to pick out the 'intersecting' elements from these 5 vectors.
'intersect(A,B)' works with only 2 vectors. Is there a command/procedure for more than 2 vectors?
Thanks.

Best Answer

You could call INTERSECT multiple times:
A = [1 2 3 4 5];B = [3 7 8 9 5];C = [5 0 22 3 77];
F = intersect(intersect(A,B),C)
Or download this file, or this collection.