Hello. I have an 8x2 matrix: M = [1 2; 5 8; 3 1; 6 6; 7 1; 1 2; 3 1; 7 1]; I would like to count how many times each line (x,y) repeats. The result should be, for example, like this: Trying: [i,j]=hist(M,unique(M)); out=[j' sum((i),2)]
What you’ve already done?
– Tuxpilgrim
I tried this: [i,j]=hist(M,Unique(M)); out=[j' sum((i),2)]. But they are adding up each element and not the pair x,y.
– Rodrigo