MATLAB: Select the indexes corresponding to the n lowest values in a vector.

MATLABminsortvector

Hello!
I have a vector that I want to return the index position of n lowest values from. I can easily select the lowest with min() and I cal also get the lowest by sorting the array and select the n first values. However, I want the index position of the n lowest values in the unsorted vector.

Best Answer

[Values,Indices]=mink(vector,n)