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 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!