MATLAB: How to display the indices of a vector in descending order of values in matlab

functionMATLABvector

I work on a matlab function I have a vector and I would to display the indices of values in the vector but in descending order of values how i can do that example V = [5 3 10] I would like to display Result [3 1 2] Thanks in advance

Best Answer

>> V = [5 3 10];
>> [~,id] = sort(V,'descend')
id =
3 1 2