Which algorithm performs random shuffling of data in Matlab (randperm function)?

1 回表示 (過去 30 日間)
I would like to know Which algorithm performs random shuffling of data in Matlab (randperm function) . Is it Knuth shuffling algorithm or something else?

採用された回答

David Sanchez
David Sanchez 2013 年 5 月 7 日
Try this out:
data = [1 2 3 4 5 6 7 8 9]; % your data
rand_pos = randperm(length(data)); %array of random positions
% new array with original data randomly distributed
for k = 1:length(data)
data_randomly_placed(k) = data(rand_pos(k));
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by