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 个评论
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