Prefer to post the data such that the users can copy&paste them without the need of further editing - then posting an answer does not demand for tedious editing:
Data = [1 3 12.772348; ...
1 3 295.54461; ...
1 5 121.18079; ...
1 5 141.528104; ...
1 6 253.601575; ...
1 6 74.807279; ...
1 7 69.999278; ...
2 10 48.2051; ...
2 11 267.308963; ...
2 11 78.648585; ...
2 12 125.921451; ...
2 12 52.058998; ...
2 12 82.227857];
Using findgroups and splitapply:
[G, D1, D2] = findgroups(Data(:,1), Data(:,2));
M = splitapply(@mean, Data(:, 3), G)
Result = [D1, D2, M];
Or with accumarray:
[K, ~, G] = unique(Data(:, 1:2), 'rows');
Result = [K, accumarray(G, Data(:, 3), [], @mean)]
Best Answer