To order min to max value for matrix's row

30 ビュー (過去 30 日間)
sermet
sermet 2014 年 5 月 7 日
回答済み: José-Luis 2014 年 5 月 7 日
a=[0.412 0.322 0.300 0.112;0.222 0.05 0.350 0.555]
% I wanna order row's value min to max. like that;
a=[0.112 0.300 0.322 0.412;0.05 0.112 0.222 0.350 0.555]

採用された回答

José-Luis
José-Luis 2014 年 5 月 7 日
sortrows(sort(a,2))

その他の回答 (2 件)

Andrei Bobrov
Andrei Bobrov 2014 年 5 月 7 日
  1 件のコメント
sermet
sermet 2014 年 5 月 7 日
it works only one row, I need all rows need to be order

サインインしてコメントする。


Youssef  Khmou
Youssef Khmou 2014 年 5 月 7 日
Try :
a=sort(a,'ascend');

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by