how to select highest three maximum values from each row of an matrix

조회 수: 10 (최근 30일)
A=rand(3,8) generates a matrix of 3 rows with 8 columns
could anyone help me how to select highest three maximum values from each row.
  댓글 수: 1
madhan ravi
madhan ravi 2019년 3월 28일
So all you expect is a person to do the work for you , won’t you put any work after asking 124 questions??

댓글을 달려면 로그인하십시오.

채택된 답변

Andrei Bobrov
Andrei Bobrov 2019년 3월 28일
A=rand(3,8);
B = sort(A,2,'descend');
out = B(:,1:3);

추가 답변 (1개)

madhan ravi
madhan ravi 2019년 3월 28일
편집: madhan ravi 2019년 3월 28일
Use the same answer I gave you in your previous question.
doc maxk % read it
  댓글 수: 2
jaah navi
jaah navi 2019년 3월 28일
i tried with the maxk command but its stating Undefined function or variable 'maxk'.

댓글을 달려면 로그인하십시오.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by