I have three complex sequences X1, X2, X3. Forexample X1=[2-i 3+4i 5+7i] X2=[7+8i 4-9i 7+9i] and X3=[2+i 4+8i 3-9i]. How can I create all the six possible sequences obained from permutations of X1, X2 and X3.
The sequences should look like as below:
7+8i 4-9i 7+9i 2-i 3+4i 5+7i 2+i 4+8i 3-9i.................2+i 4+8i 3-9i 7+8i 4-9i 7+9i 2-i 3+4i 5+7i. The total number of sequences in this case is 6 (3!).

 채택된 답변

Bruno Luong
Bruno Luong 2020년 7월 18일
편집: Bruno Luong 2020년 7월 18일

1 개 추천

X1=[2-i 3+4i 5+7i]; X2=[7+8i 4-9i 7+9i]; X3=[2+i 4+8i 3-9i];
P=cell2mat(perms({X1 X2 X3}))
% Each row of P is a combined "sequence" of X1,X2 & X3 in different order

추가 답변 (1개)

madhan ravi
madhan ravi 2020년 7월 18일
편집: madhan ravi 2020년 7월 18일

0 개 추천

perms(X)

댓글 수: 1

Roland Niwareeba
Roland Niwareeba 2020년 7월 18일
Thanks. I have editted the question to make it more clear.

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

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2020년 7월 18일

댓글:

2020년 7월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by