필터 지우기
필터 지우기

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