how to randomly assign values from a vector and store it in another vector?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
giancarlo maldonado cardenas
el 18 de Nov. de 2021
Editada: giancarlo maldonado cardenas
el 18 de Nov. de 2021
good night all.
I wrote this algorithm to assign values from one vector (detected) and store in another vector (alocados), but it does it in an ordered way one by one.
How can I modify this algorithm so that it selects the values of the vector (detected) randomly, and stores them in the vector (alocados).
Any help is really appreciated.
0 comentarios
Respuestas (1)
KSSV
el 18 de Nov. de 2021
Read about randperm.
load('detected.mat')
idx = randperm(length(detected)) ;
alocados = detected(idx) ;
Ver también
Categorías
Más información sobre LTE 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!