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

1 回表示 (過去 30 日間)
navya
navya 2014 年 3 月 20 日
コメント済み: Walter Roberson 2014 年 3 月 20 日
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 Center および File ExchangeMultidimensional Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by