Azzera filtri
Azzera filtri

if I have a vector of 20 elements, how can I extract the 5 minimum elements in that vector

2 visualizzazioni (ultimi 30 giorni)
V=[23,56,12,90,45,21,56,10,70,100,15,...] a=[10,12,15,21,23]

Risposta accettata

Walter Roberson
Walter Roberson il 2 Dic 2017
sort() and take the first 5 elements of the output.

Più risposte (1)

Steven Lord
Steven Lord il 2 Dic 2017
If you're using release R2017b or later, use the mink function.

Categorie

Scopri di più su Time Series in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by