필터 지우기
필터 지우기

set of vectors from some elements?

조회 수: 2 (최근 30일)
Maha Mosalam
Maha Mosalam 2023년 4월 15일
댓글: Maha Mosalam 2023년 4월 15일
How I can obtain a set of vectors from some elements by changing its positions
for example, If I had v=[ 1 2 3 4] elemnts , thus I want to generate all cobninations of vectors , like
result= [ 1 2 3 4
2 1 3 4
4 2 3 1
1 4 3 2
....]

답변 (1개)

Rik
Rik 2023년 4월 15일
Do you need all permutations in one array? Then you can use the perms function. Note that the array size quickly grows with the number of elements in your vector.
If you don't need all combinations in one array, you may consider procedurally generating the swaps.
  댓글 수: 1
Maha Mosalam
Maha Mosalam 2023년 4월 15일
Many thanks , I will check all

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by