We cannot have a look into the randperm function. So if it is essential for you program to produce the same sequence of random numbers, you have to use
r = randperm(10); r(1:4);
in your program, also in the R2015b version.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!