Use combvec for pairs of values
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I have a matrix (20 x 2) .
I would like to create 4 possible combinations of each pair of values present on each row of this matrix into a new matrix with 8 columns.
Basically, I would like to use combvec but instead of using scalars, I would be using pairs of values.
Any ideas?
Tnks
댓글 수: 0
답변 (2개)
DGM
2021년 10월 30일
If there's only two columns, what's wrong with just doing
A = randi(9,20,2)
B = A(:,[1 1 1 2 2 1 2 2])
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!