MATLAB: How to cross-reference values in one array with another (of different sizes)

logical indexing

I have two arrays, each containing strings which define subject IDs.
The arrays contain different numbers of subjects, and overlap significantly (but not entirely).
How do I create a logical index for each cell in array 1, where values of True(1) are given when that string appears in both arrays, and values of False(0) are given when the string only appears in array 1.
I could probably do this with a for loop for each cell in array 1 but I feel like there is a better, more obvious way.
Thank you!
EXAMPLE:
ARRAY1: [ID1 ID2 ID3 ID4 ID5 ID6 ID7 ID8 ID9]
ARRAY2: [ID2 ID9 ID4 ID11]
DESIRED OUTPUT: [0 1 0 1 0 0 0 0 1 0]

Best Answer

ismember(Array1,Array2)