I have a two row matrix and I want to be able to extract some metrics (i.e. mean, median std) from numbers in the 2nd row based on associated values in the first row. So if I had:
a=[1 1 1 2 2 4; 3 5 4 7 2 5]
I'd like to compute the mean of row 2 associated with different values in row 1, so I'd want the mean of 3 5 and 4, mean of 7 and 2, and mean of 5. These metrics would then be output to a new 2 row matrix:
i.e. [1 2 4; 4 4.5 5]
Any pointers would be appreciated
Best Answer