Select a certain number of mine Vector Members in MATLAB
조회 수: 2 (최근 30일)
이전 댓글 표시
채택된 답변
KSSV
2020년 10월 6일
Let v be your vector. You can arrange them from small to big order i.e in ascending order and then pick first twenty elements.
[val,idx] = sort(v) ;
val(1:20) % values
idx(1:20) % indices
댓글 수: 3
KSSV
2020년 10월 6일
You already have the indices in your hand as idx which corresponds to original vector. This is not a problem. The positions are according to vector v.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Directed Graphs에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!