Shuffle

Random permutation of array elements, C-Mex: much faster than RANDPERM

Download
Download

You are now following this Submission

Cite As

Jan (2026). Shuffle (https://uk.mathworks.com/matlabcentral/fileexchange/27076-shuffle), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.4.0

Some percent faster, bugfix for 64-bit index vectors, derangements - Thanks to Derek O'Connor.

Download
1.3.0

Bugfix for [1 x 4] seeds.
Shuffle([], 'seed') to initialize the RNG with the default seed.
Mex is locked in the memory to prevent the RNG status from being reinitialiized by CLEAR ALL (thanks to Ulrik Nash!).

Download
1.2.0

Can be compiled with LCC 2.4 (shipped with Matlab) now. Thanks to James Tursa for the helpful ideas!

Download
1.1.0

Create index vector with optionally reduced length, dimension to operate on can be specified. *New interface* !

Download
1.0.0

Download