how to randomly assign values from a vector and store it in another vector?
이전 댓글 표시
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.
답변 (1개)
KSSV
2021년 11월 18일
Read about randperm.
load('detected.mat')
idx = randperm(length(detected)) ;
alocados = detected(idx) ;
카테고리
도움말 센터 및 File Exchange에서 LTE Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!