I wish to comapre two vectors or matrices and see if they have the same numbers but they may not be in the same order such as:

1 2 3 and 2 3 1

4 5 6 4 6 5

7 8 9 8 9 7

or

1 2 3 4 5

vs

3 4 2 5 1

Skip to content# MATLAB: Compare two matrices or vectors that have the same numbers but in different order

###### Related Question

MATLABmatrix order

I wish to comapre two vectors or matrices and see if they have the same numbers but they may not be in the same order such as:

1 2 3 and 2 3 1

4 5 6 4 6 5

7 8 9 8 9 7

or

1 2 3 4 5

vs

3 4 2 5 1

- Sort array elements in ascending order
- How to extract the most similar(closest) one
- If A is a 3×4 matrix, how do you find B if B=A(1:2)
- Ismembertol command calculating average between two matched rows
- Ismembertol not working correctly
- How to sort/Rearrange a matrix
- Finding common lat/long points within a range from two data sets of unequal length

## Best Answer