フィルターのクリア

How to arrange ascending order only one column of a matrix?

3 ビュー (過去 30 日間)
Arnab Pal
Arnab Pal 2018 年 2 月 15 日
回答済み: Andrei Bobrov 2018 年 2 月 15 日
Let's say, I have a=[25 10 85 35 71; 1 2 3 4 5] and output shout come b=[10 25 35 71 85; 2 1 4 5 3]

採用された回答

Birdman
Birdman 2018 年 2 月 15 日
b=sortrows(a.').'

その他の回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2018 年 2 月 15 日
[~,ii] = sort(a(1,:));
out = a(:,ii);

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by