The problem is to select rows in a matrix based on string value in the first column. Then sum the total in the corresponding entries in the second column. Given. For example, given
mat = {'foobar', 77; 'faabar', 81; 'foobur', 22; 'faabaa', 8; 'faabian', 88; 'foobar', 27; 'fiijii', 52};
and given list
{'foo', 'faa'}
The problem is to select rows in which the string in the list is part of the string in the first column in the matrix, and then sum the total in the second column for each row found. Hence the result of the above should be
'foo' 'faa' [126] [ 177]