Created
September 19, 2017 04:32
-
-
Save rysk-t/c832dd7da1d35e5b12960fc09b29ff8e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shuffled_idx = ratio_shuffle(len, ratio) | |
% hidx = 1:4:length(tune(:)); | |
% hidxs = hidx(randperm(length(hidx))); | |
% tune_h = tune; | |
% tune_h(hidx) = tune(hidxs); | |
shuffled_idx = 1:len; | |
soi = randperm(len); | |
soi_s = soi(1:floor(len*ratio)); | |
soi_s = soi_s(randperm(length(soi_s))); | |
shuffled_idx(soi(1:floor(len*ratio))) = soi_s; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment