To order min to max value for matrix's row

30 views (last 30 days)
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]

Accepted Answer

José-Luis
José-Luis on 7 May 2014
sortrows(sort(a,2))

More Answers (2)

Andrei Bobrov
Andrei Bobrov on 7 May 2014

Youssef  Khmou
Youssef Khmou on 7 May 2014
Try :
a=sort(a,'ascend');

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!