This functionality has been around on the File Exchange for years. For instance, you might take a look at my RANDSWAP function
http://www.mathworks.nl/matlabcentral/fileexchange/12621-randswap
or RANDMAT by Peter Bodin
http://www.mathworks.nl/matlabcentral/fileexchange/7203-randmat
Here is the rather trivial one-liner for shuffling any array X (numbers, ND, cell, string, whatever):
X(randperm(numel(X)) = X ;
which maintains everything, except the order!
Your help section is pretty good; I'd suggest you try to follow ML standards, e.g., by creatin a proper H1 line, and example, and a See Also section (take a look at the help of any of the main ML functions)
This functionality has been around on the File Exchange for years. For instance, you might take a look at my RANDSWAP function
http://www.mathworks.nl/matlabcentral/fileexchange/12621-randswap
or RANDMAT by Peter Bodin
http://www.mathworks.nl/matlabcentral/fileexchange/7203-randmat
Here is the rather trivial one-liner for shuffling any array X (numbers, ND, cell, string, whatever):
X(randperm(numel(X)) = X ;
which maintains everything, except the order!
Your help section is pretty good; I'd suggest you try to follow ML standards, e.g., by creatin a proper H1 line, and example, and a See Also section (take a look at the help of any of the main ML functions)
Comment only