Ranking matrix by rows

1 回表示 (過去 30 日間)
sushma sharma
sushma sharma 2015 年 2 月 11 日
編集済み: Azzi Abdelmalek 2015 年 2 月 11 日
Hi,
I have a 3x3 matrix. I want to create a matrix that shows the magnitude rank of the elements in the rows with 1 being the maximum and 3 being the minimum. for example:
a = [3 4 1; 5 1 8; 8 4 1]
b = [2 1 3; 2 3 1; 1 2 3]
Any help would be appreciated!
Sushma

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 2 月 11 日
編集済み: Azzi Abdelmalek 2015 年 2 月 11 日
EDIT
[~,jj]=sort(a,2,'descend');
[~,b]=sort(jj,2)

その他の回答 (0 件)

カテゴリ

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