%% Generate Random Permutation of Integers
% Create a random stream s and generate a random permutation of the integers from 1 to 6 based on s.

s = RandStream('mt19937ar','Seed',0);
p = randperm(s,6)

% Use the random stream s to generate three integers between 1 and 10.

p = randperm(s,10,3)

%
% Copyright 2008-2020 The MathWorks, Inc.