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!