Hi,Is there anyone who could give an idea how to create a permutation vector?

1 次查看(过去 30 天)
Like,every time the loop constructs,the vector would change.
For example V1=[1 2 3 5 4]; V2=[2 3 1 5 4] and go on?

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2016-6-6
V1=[1 2 3 5 4]
n=numel(V1)
idx=randperm(n)
V2=V1(idx)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by