how to sort matrix according to another matrix in matlab
Show older comments
I have a two matrix
A=[ 1 2 3;
2 1 4;
1 3 2; ]
and
B=[1 2 3]
i want the output matrix like,
C =[1 2 3;
1 2 4;
1 2 3]
how to get this output. The matrix A is sorted according to the matrix B.
Thanks.
4 Comments
Azzi Abdelmalek
on 1 Nov 2012
can you explain?
Azzi Abdelmalek
on 1 Nov 2012
Edited: Azzi Abdelmalek
on 1 Nov 2012
what if B=[1 3 2] what should be C
Azzi Abdelmalek
on 2 Nov 2012
Edited: Azzi Abdelmalek
on 2 Nov 2012
what if B=[1 3 2] what should be C
Accepted Answer
More Answers (0)
Categories
Find more on Shifting and Sorting Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!