Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Indices of highest values in a vector when values are repeated
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I have used the following code to find the top 50% highest values in vector A:
top = round(0.5*length(A))
c = flipud(unique(sort(A)))
result = c(1:top)
index=find(node_degree>=c(top))
result_at=flipud(sortrows([A(index) index], 1))
The issue that I have is some of the values are equal in A. If I have a situation where e.g.:
A = [ 20; 19; 18; 17; 17; 17; 2; 2; 2; 2]
The current code would return indices [1:5], what I would like it to do is expand its selection to return [1:6], i.e. return indices for all values that are in an equal position.
Many thanks for any assistance,
Rob
0 件のコメント
回答 (1 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!