I'm stuck on this problem for a while. I want to obtain a matrix which is averaged for the rows which contain the same first two elements. I don't want to clear the rows which are not equal for the first two elements. When I have a matrix A:
A=[1 1 1 1 1 1 2 3 4 5 1 2 4 4 4 1 2 3 3 3 2 2 2 2 2 2 2 3 3 3]
I want the outcome to be:
A=[1 1 1 1 1 1 2 3.33 3.67 4 2 2 2.5 2.5 2.5]
I hope someone could help me on this.
Best Answer