how to find max of a column and run it in a loop

조회 수: 3 (최근 30일)
raqib Iqbal
raqib Iqbal 2020년 7월 3일
편집: madhan ravi 2020년 7월 3일
device=[1 2 3 4 5 6 7 8 9 10]
block=[1 10;2 11;3 7;4 13;5 14]
new=block(block(:,1) == max(block(:,1)),:)
how to run this max value finding in a loop and display with adding elemnt from device array? like after first find output will be 1 5 14 and last output will be 5 3 7.
  댓글 수: 5
raqib Iqbal
raqib Iqbal 2020년 7월 3일
block=[1 10;2 11;3 7;4 13;5 14] row 3 and min c2 value
raqib Iqbal
raqib Iqbal 2020년 7월 3일
block=[1 10;2 11;3 7;4 13;5 14]
sir you just tell me how to display max of C2 value to min of C2 value (dscending order) with their corresponding c1 value

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

채택된 답변

madhan ravi
madhan ravi 2020년 7월 3일
편집: madhan ravi 2020년 7월 3일
C = sortrows(block, 2, 'descend') %?

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by