2011-05-05 74 views
0

嘿那裏, 有沒有什麼方法可以隨機混合輸入矢量元素的順序?說我輸入Matlab:混合輸入矢量

[1:5] '

我想出去,例如:

[3 5 1 2 4]'

的感謝!

回答

5

使用RANDPERM

shuffledOutput = inputVector(randperm(length(inputVector))); 
+0

謝謝,我會考慮它:) – tim 2011-05-05 16:23:06