To order min to max value for matrix's row

조회 수: 4 (최근 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 CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by