How to sort a matrix by row based on an index array

3 Ansichten (letzte 30 Tage)
JFz
JFz am 8 Jan. 2018
Beantwortet: Stephen23 am 8 Jan. 2018
Hi, I have an index array ib which is a result of two table joining. I have a matrix M, I would like to sort M by rows according to ib. For example, if ib is [2, 1, 3], I would like the 2nd row to move up to be the first row. How to do that? Thanks!

Antworten (1)

Stephen23
Stephen23 am 8 Jan. 2018

Kategorien

Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by