One way to do it:
data = [878.00 9.00
1.00 12.00
166.00 12.00
143.00 12.00
160.00 12.00
173.00 12.00
144.00 12.00
3229.00 0
150.00 12.00
144.00 12.00
122.00 13.00
132.00 13.00
2.00 13.00
138.00 13.00
139.00 14.00
133.00 14.00
4.00 14.00
137.00 14.00
2473.00 0
118.00 14.00
127.00 14.00];
data = data(data(:,1)>=10,:);
data = data(data(:,2)~=0,:);
elems = unique(data(:,2));
elemSums = arrayfun(@(x)(sum(data(data(:,2)==x))), elems);
fprintf('T value: %.2f | Sum: %.2f\n', [elems elemSums].')
Result:
T value: 9.00 | Sum: 878.00
T value: 12.00 | Sum: 1080.00
T value: 13.00 | Sum: 392.00
T value: 14.00 | Sum: 654.00
Best Answer