MATLAB: Work with matrix of words and number

calculating mean

Hey guys,
I work with matrix that have words on one column and their corresponding value on the other column as such
'Apple' 13.6000000000000
'Apple' 7.23200000000000
'Apple' 6.73600000000000
'Ball' 1.34900000000000
'Cat' 1.71600000000000
'Dog' 2.66100000000000
'Cat' 0.771000000000000
and the order of these words is random. I need to calculate the mean for individual words. I appretiate any help.
thanks

Best Answer

T = readtable('txtfile.txt')
T_out = varfun(@mean,T,'GroupingVariables','Var1');
Related Question