I have this matrix:
1 01 21 32 32 43 13 6
In the second column, I need to find the highest and lowest number that are associated with the same number in the first column, and then subtract the two. In row 1, the numbers 1 and 0 exist. In row 3, the numbers 1 and 3 exists. I need to subtract the 3 and the 0 and get 3 as my output.
The output should be a matrix that looks like this:
1 32 13 5
Also if a number in the first column only occurs once
1 0 1 2 1 3 2 3 2 4 3 1 3 6 4 5
Then the number in the second column associated with it in the output matrix should be a 0.
1 32 13 54 0
Best Answer