I have a 150×2 matrix in which the first column contains numbers that can be considered 'grouping variables' and the second column contains values associated with those grouping variables. So a small 6×2 version would look like this
1 23 1 29 1 43 2 38 2 22 2 100
I'd like to find the maximum of the values associated with each grouping variable. Similarly the minimum amongst the values associated with each grouping variable. So the above example would yield an max of 43(for variable 1) and min of 23 (for variable 1). Similarly, max of 100 (for variable 2) and min of 22 (for variable 2). Does anybody know of a similar function or method to achieve this in Matlab?
Best Answer