I have an array of any length and I want to sort them in descending order. The position and value in that matrix refer to an ID of a node. So my question is that how I can sort this array in descending order and I should have idea of node position in array after sorting out.
Like I have a matrix A and the first value of the array is 5 but its ID is 1 and second value is 4 and its ID is 2 so after descending it goes to some new position 11 and 4 to 12 in the array. then whether i can get in a variable the position of variables after sorting out.
if true A = [ 5 4 61 7 1 3 35 67 11 44 83 48 110 6] B = sort (A, 'descend'); B = 110 83 67 61 48 44 35 11 7 6 5 4 3 1 ID_pos of 5 = 11 and ID_pos of 4 = 12 so how to get these index automatically. end
Kindly guide me
Best Answer