MATLAB: How to process the output of fuzzy interface system(chance parameter) to select the indexes of first 3 maximum chance values??

chancefuzzy interface systemFuzzy Logic Toolbox

My project is " clustering in wireless sensor network using Fuzzy logic", Am doing this for 60 nodes. In this project the node with the maximum chance value will become the cluster head. the chance values for all 60 node is stored in the array variable "LQ", i need to select the 3 cluster head with maximum chance parameter to do this i need the indexes of the first 3 maximum chance parameter. here i need the indexes value……

Best Answer

Ok, I see, not really a Fuzzy Logic question, more of a basic MATLAB question.
x=rand(60,1); %test vactor of 60 random numbers
[svals,idx]=sort(x,'descend'); %sort in descending order
svals(1:3) %the 3 largest values
idx(1:3) % the indices of 3 largest values