MATLAB: Strcmp for two different Cells

cellcomparestrcmp

Hello,
is it possible to compare two Cell-Variables with different sizes?
Example:
var1 = {'A', 'B', 'C'}
var2 = {'A', 'AA', 'B', 'BB', 'BB' , 'U' , 'V' , 'W' }
strcmp(var1,var2)
Result
>> ans = 1 0 1 0 0 0 0 0
The functions checks one element from var1 is existing in var2.

Best Answer

Use ismember:
var1 = {'A', 'B', 'C'}
var2 = {'A', 'AA', 'B', 'BB', 'BB' , 'U' , 'V' , 'W'}
ismember(var2, var1)