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!