How to pick randomly elements from a vector without repetation?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
IBM watson
el 22 de Oct. de 2018
Editada: Bruno Luong
el 22 de Oct. de 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 comentarios
Respuesta aceptada
Bruno Luong
el 22 de Oct. de 2018
Editada: Bruno Luong
el 22 de Oct. de 2018
a(randperm(length(a),2))
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre WLAN Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!