MATLAB: Find repeated pairs of two variables

pairsrepeated

I have height and weight of 10 subjects. I want to find how many subjects having the same height has the same weight. That is I need to find the repeated pair( height, weight) I tried "unique" and "ismember" but it's not working.Thanks in advance

Best Answer

How about this?
% examples
weight = randi([70 74], 10, 1);
height = randi([5 7], 10, 1);
[~,i] = unique(findgroups(height, weight));
li = false(numel(weight),1);
li(i) = true;
repeats = unique([height(~li) weight(~li)], 'rows');