To order min to max value for matrix's row

2 Ansichten (letzte 30 Tage)
sermet
sermet am 7 Mai 2014
Beantwortet: José-Luis am 7 Mai 2014
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]

Akzeptierte Antwort

José-Luis
José-Luis am 7 Mai 2014
sortrows(sort(a,2))

Weitere Antworten (2)

Andrei Bobrov
Andrei Bobrov am 7 Mai 2014
  1 Kommentar
sermet
sermet am 7 Mai 2014
it works only one row, I need all rows need to be order

Melden Sie sich an, um zu kommentieren.


Youssef  Khmou
Youssef Khmou am 7 Mai 2014
Try :
a=sort(a,'ascend');

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by