combination cases using a value more than once
조회 수: 2 (최근 30일)
이전 댓글 표시
A = [1 2 3 4 5]
I want to create a matrix of all possible combinations for no. of columns, n=3
[1 1 1; 1 1 2; 1 1 3; 1 2 1; ...; 5 5 5]
I want the value of A and n to be variable. I tried to use nchoosek but I can not get it to do what I want
Is there a function that does this for me?
댓글 수: 0
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Discrete Math에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!