Hi
I have a matrix as follows
x=[1 3; 1 4; 1 6; 2 5; 2 7; 3 4; 3 11; 3 1; 3 2]
I want to write a code or a loop that aggregates the numbers in the second column for each different number in the first column.
The result should be
y= [1 13; 2 12; 3 18]
Best Answer