Let's say we have a vector A = [1,4,2] and we wish to sort it according to the order given by B = [4,5,1,2] The end result should give A = [4,1,2]. Is there an existing way in Matlab to accomplish this?
MATLAB: Sorting a vector by another vector with same terms
sortvector
Related Question
- How to enumerate an array
- Whhat is the best way to remove repitions of two or three vectors
- Sort without duplicate
- How to select specific letters in a name
- Sorting Vector A in Ascending order and apply the same steps to Vector B
- How to get the length of the intersection of each row of a matrix with another vector
- Sorting matrix
- Number of times two numbers appear together
Best Answer