Matlab Shuffle Array Mar 6, 2014 To shuffle a: a(randperm(length(a))) Example: a = [10 2 5 20]; a = a(randperm(length(a))) a = 5 10 2 20 Source. [ Matlab ]