Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个像这样的矩阵:
A= 4 7 8 9 3 3 5 7 6 4 8 6
并希望随机洗牌并执行以下操作:
A= 8 4 9 7 5 3 7 3 8 6 6 4
有人有什么主意吗?
您可以使用索引对列进行洗牌:
A(:,[3 1 4 2])
如果你想随机做,你可以创建一个随机排列:
A(:,randperm(size(A,2)));