Search for occurences of word in matrix