Suppose i have two arrays a=[4 3 6 1 7 8] b=[3 5 1 8 4 6]
I need to sort b in the same order as a, which will be sorted in ascending order ie.,
first sorting a a=[1 3 4 6 7 8] whose corresponding indices will be [4 2 1 3 5 6] and using this indices, i have to sort b, ie., b=[8 5 3 1 4 6]
how do i do this in MATLAB