How to select the indexes of maximum 3 values in the array without sorting?

조회 수: 1 (최근 30일)
Find the index of the largest 3 elements?

채택된 답변

Walter Roberson
Walter Roberson 2014년 3월 20일
"for" loop.
  댓글 수: 2
navya
navya 2014년 3월 20일
could you please explain me with an example??
Walter Roberson
Walter Roberson 2014년 3월 20일
for K = 1 : length(x)
if x(K) > 5
disp(K)
end
end
the above example does not try to find any maximums, it just shows how you can create a loop that examines values in the array and does something conditionally.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by