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

2 ビュー (過去 30 日間)
JFz
JFz 2018 年 1 月 8 日
回答済み: Stephen23 2018 年 1 月 8 日
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!

回答 (1 件)

Stephen23
Stephen23 2018 年 1 月 8 日
M(ib,:)

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by