I have a vector of data X that I want to divide into 10 different groups depending on the values. i,e the highest 10% together, then the lower 10% together etc…. How can I create another vector that assigns numbers to such groups. For example highest 10% should have a value of 1, then the lower 10% a value of 2 , … then the lowest 10% a value of 10. I used :
DecileThresholds= quantile(X,(1:9)/10);to find the points that separates the categories but I don't want to write a loop to categorize them. I thought that matlab probably has a function that automatically and elegantly give me the category number. Thanks
Best Answer