If you have a cell-array of words you want to check, you should use ismember
. So, if you had a dictionary array dict
and a set of words words
, you would use
check = ismember(words,dict);
where check
would be something along the lines of [0,1,1]
, if the first word wasn't in the dictionary, but the other two were.
EDIT:
I guess that dictionary
is a function? Sorry, I didn't pick up on that the first time around. In that which case, borrowing from this answer to a different question, you can do the following:
dict_fun = @(word,trash)dictionary(word);
check = bsxfun(dict_fun,nchoosek('london',3),1);