Given the following cell array of strings:
a(1) = {{'one', 'two', 'three', 'four'}}
a(2) = {{'one', 'two', 'four', 'five'}}
a(3) = {{'four', 'five', 'six', 'seven'}}
b = {'one', 'two'}
is there a way to check whether both strings in b
are contained in each subcell of a
?
In my example a(1)
and a(2)
would fill this requirement.
>> cellfun(@(x) all(ismember(b, x)), a)
ans =
1 1 0