How to pick randomly elements from a vector without repetation?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
IBM watson
il 22 Ott 2018
Modificato: Bruno Luong
il 22 Ott 2018
If I have a vector like this :
a=[1 2 3 4 5]
i know how to do this but my vector is something like:
a=[23 46 4 2 5]
I should pick 2 elements randomly without repetation.
0 Commenti
Risposta accettata
Bruno Luong
il 22 Ott 2018
Modificato: Bruno Luong
il 22 Ott 2018
a(randperm(length(a),2))
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su WLAN Toolbox 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!