Select a certain number of mine Vector Members in MATLAB
조회 수: 1 (최근 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개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!