Matlab Tricks(二十六)—— 置乱(随机化)与恢复(shuffle/permutation & restore)

x = 1:10;
n = length(x);
perm = randperm(n);

x_perm = x(perm);
            % x_perm 表示置乱后的结果
x_ori(perm) = x_perm;
            % x_ori 对置乱后的结果进行恢复
原文地址:https://www.cnblogs.com/mtcnn/p/9422513.html