MATLAB: To order min to max value for matrix’s row

matrix

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]

Best Answer

sortrows(sort(a,2))
Related Question