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

random shuffling of data

I would like to know Which algorithm performs random shuffling of data in Matlab (randperm function) . Is it Knuth shuffling algorithm or something else?

Best Answer

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