Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
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?

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by